-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export declare const KEY_A = 65; | ||
export declare const KEY_RETURN = 13; | ||
export declare const KEY_ESC = 27; | ||
export declare const KEY_LEFT = 37; | ||
export declare const KEY_UP = 38; | ||
export declare const KEY_RIGHT = 39; | ||
export declare const KEY_DOWN = 40; | ||
export declare const KEY_BACKSPACE = 8; | ||
export declare const KEY_DELETE = 46; | ||
export declare const KEY_TAB = 9; | ||
export declare const IS_MAC: boolean; | ||
export declare const KEY_SHORTCUT: string; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* highlight v3 | MIT license | Johann Burkard <[email protected]> | ||
* Highlights arbitrary terms in a node. | ||
* | ||
* - Modified by Marshal <[email protected]> 2011-6-24 (added regex) | ||
* - Modified by Brian Reavis <[email protected]> 2012-8-27 (cleanup) | ||
*/ | ||
export declare const highlight: (element: HTMLElement, regex: string | RegExp) => void; | ||
/** | ||
* removeHighlight fn copied from highlight v5 and | ||
* edited to remove with(), pass js strict mode, and use without jquery | ||
*/ | ||
export declare const removeHighlight: (el: HTMLElement) => void; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* MicroEvent - to make any js object an event emitter | ||
* | ||
* - pure javascript - server compatible, browser compatible | ||
* - dont rely on the browser doms | ||
* - super simple - you get it immediatly, no mistery, no magic involved | ||
* | ||
* @author Jerome Etienne (https://github.com/jeromeetienne) | ||
*/ | ||
type TCallback = (...args: any) => any; | ||
export default class MicroEvent { | ||
_events: { | ||
[key: string]: TCallback[]; | ||
}; | ||
constructor(); | ||
on(events: string, fct: TCallback): void; | ||
off(events: string, fct: TCallback): void; | ||
trigger(events: string, ...args: any): void; | ||
} | ||
export {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/** | ||
* microplugin.js | ||
* Copyright (c) 2013 Brian Reavis & contributors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this | ||
* file except in compliance with the License. You may obtain a copy of the License at: | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF | ||
* ANY KIND, either express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
* | ||
* @author Brian Reavis <[email protected]> | ||
*/ | ||
type TSettings = { | ||
[key: string]: any; | ||
}; | ||
type TPlugins = { | ||
names: string[]; | ||
settings: TSettings; | ||
requested: { | ||
[key: string]: boolean; | ||
}; | ||
loaded: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
export type TPluginItem = { | ||
name: string; | ||
options: {}; | ||
}; | ||
export type TPluginHash = { | ||
[key: string]: {}; | ||
}; | ||
export default function MicroPlugin(Interface: any): { | ||
new (): { | ||
[x: string]: any; | ||
plugins: TPlugins; | ||
/** | ||
* Initializes the listed plugins (with options). | ||
* Acceptable formats: | ||
* | ||
* List (without options): | ||
* ['a', 'b', 'c'] | ||
* | ||
* List (with options): | ||
* [{'name': 'a', options: {}}, {'name': 'b', options: {}}] | ||
* | ||
* Hash (with options): | ||
* {'a': { ... }, 'b': { ... }, 'c': { ... }} | ||
* | ||
* @param {array|object} plugins | ||
*/ | ||
initializePlugins(plugins: string[] | TPluginItem[] | TPluginHash): void; | ||
loadPlugin(name: string): void; | ||
/** | ||
* Initializes a plugin. | ||
* | ||
*/ | ||
require(name: string): any; | ||
}; | ||
[x: string]: any; | ||
/** | ||
* Registers a plugin. | ||
* | ||
* @param {function} fn | ||
*/ | ||
define(name: string, fn: (this: any, settings: TSettings) => any): void; | ||
}; | ||
export {}; |