Skip to content

Instantly share code, notes, and snippets.

@Jason-Rev
Created March 26, 2016 15:22
Show Gist options
  • Save Jason-Rev/44863e63369bad887edf to your computer and use it in GitHub Desktop.
Save Jason-Rev/44863e63369bad887edf to your computer and use it in GitHub Desktop.
declare module 'JSONSelect' {
type Callback = (value: any) => any;
interface JsonSelectInstance {
match(obj: any): any[];
foreach(obj: any, fn: Callback): void;
}
interface JsonSelect {
match(select: string, json: any): any[];
match(select: string, args: string[], json: any): any[];
foreach(select: string, json: any, callback: Callback): any[];
foreach(select: string, args: string[], json: any, callback: Callback): any[];
compile(select: string, json: any): JsonSelectInstance;
compile(select: string, args: string[], json: any): JsonSelectInstance;
}
const jsonSelect: JsonSelect;
export = jsonSelect;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment