Skip to content

Instantly share code, notes, and snippets.

@ntilwalli
Created January 19, 2016 21:03
Show Gist options
  • Select an option

  • Save ntilwalli/08c6657313222007aedb to your computer and use it in GitHub Desktop.

Select an option

Save ntilwalli/08c6657313222007aedb to your computer and use it in GitHub Desktop.
Incomplete Typescript definition files
declare module "@cycle/core" {
export interface DefinitionFunction<I, O> {
(drivers: I): O
}
export interface DriversDefinition {
[ driverName: string ]: Function
}
export function run<I, O>(app: DefinitionFunction<I, O>, drivers: DriversDefinition): {sinks: I, sources: O};
}
declare module "@cycle/dom" {
export interface VTree {}
export interface HasSelect {
select: DOMSelectFunction
}
export interface DOMSelectFunction {
(selector: string): DOMSelectOutput
}
export interface DOMEventsFunction {
(eventName: string, options?: Object): Rx.Observable<Event>
}
export interface IsolateSourceFunction {
(source: HasSelect, scope: string): DOMSelectOutput
}
export interface IsolateSinkFunction {
(sink: Rx.Observable<VTree>, scope: string): Rx.Observable<VTree>
}
export interface DOMSelectOutput extends HasSelect {
observable: Rx.Observable<Element>,
namespace: string[],
events: DOMEventsFunction
isolateSource: IsolateSourceFunction
isolateSink: IsolateSinkFunction
}
export interface DOMDriverOutput extends HasSelect {
observable: Rx.Observable<Element>
namespace: string[]
events: DOMEventsFunction
dispose: () => void
isolateSource: IsolateSourceFunction
isolateSink: IsolateSinkFunction
}
interface DOMDriverFunction {
(vtree$: Rx.Observable<any>, driverName: string): DOMDriverOutput
}
export function makeDOMDriver(container: string | Element, customElements?: any): DOMDriverFunction;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment