From 130a075a919bb413fa0499031f9f9f9f5a7217b5 Mon Sep 17 00:00:00 2001 From: Chris Bowdon Date: Sat, 14 Feb 2015 13:32:34 +0000 Subject: [PATCH] Fixed weird 7-space indentation in d.ts (now 4) --- mithril.d.ts | 176 +++++++++++++++++++++++++-------------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/mithril.d.ts b/mithril.d.ts index 43575f08..06264c71 100644 --- a/mithril.d.ts +++ b/mithril.d.ts @@ -2,164 +2,164 @@ interface MithrilStatic { - (selector: string, attributes: MithrilAttributes, ...children: Array): MithrilVirtualElement; - (selector: string, ...children: Array): MithrilVirtualElement; + (selector: string, attributes: MithrilAttributes, ...children: Array): MithrilVirtualElement; + (selector: string, ...children: Array): MithrilVirtualElement; - prop(promise: MithrilPromise) : MithrilPromiseProperty; - prop(value: T): MithrilProperty; - prop(): MithrilProperty; // might be that this should be Property + prop(promise: MithrilPromise) : MithrilPromiseProperty; + prop(value: T): MithrilProperty; + prop(): MithrilProperty; // might be that this should be Property - withAttr(property: string, callback: (value: any) => void): (e: MithrilEvent) => any; + withAttr(property: string, callback: (value: any) => void): (e: MithrilEvent) => any; - module(rootElement: Node, module: MithrilModule): T; - module(rootElement: Node): T; + module(rootElement: Node, module: MithrilModule): T; + module(rootElement: Node): T; - trust(html: string): string; + trust(html: string): string; - render(rootElement: Element|HTMLDocument): void; - render(rootElement: Element|HTMLDocument, children: MithrilVirtualElement, forceRecreation?: boolean): void; - render(rootElement: Element|HTMLDocument, children: MithrilVirtualElement[], forceRecreation?: boolean): void; + render(rootElement: Element|HTMLDocument): void; + render(rootElement: Element|HTMLDocument, children: MithrilVirtualElement, forceRecreation?: boolean): void; + render(rootElement: Element|HTMLDocument, children: MithrilVirtualElement[], forceRecreation?: boolean): void; - redraw: { - (force?: boolean): void; - strategy: MithrilProperty; - } + redraw: { + (force?: boolean): void; + strategy: MithrilProperty; + } - route: { - (rootElement: HTMLDocument, defaultRoute: string, routes: MithrilRoutes): void; - (rootElement: Element, defaultRoute: string, routes: MithrilRoutes): void; + route: { + (rootElement: HTMLDocument, defaultRoute: string, routes: MithrilRoutes): void; + (rootElement: Element, defaultRoute: string, routes: MithrilRoutes): void; - (element: Element, isInitialized: boolean): void; - (path: string, params?: any, shouldReplaceHistory?: boolean): void; - (): string; + (element: Element, isInitialized: boolean): void; + (path: string, params?: any, shouldReplaceHistory?: boolean): void; + (): string; - param(key: string): string; - mode: string; - } + param(key: string): string; + mode: string; + } - request(options: MithrilXHROptions): MithrilPromise; + request(options: MithrilXHROptions): MithrilPromise; - deferred: { - onerror(e: Error): void; - (): MithrilDeferred; - } + deferred: { + onerror(e: Error): void; + (): MithrilDeferred; + } - sync(promises: MithrilPromise[]): MithrilPromise; + sync(promises: MithrilPromise[]): MithrilPromise; - startComputation(): void; - endComputation(): void; + startComputation(): void; + endComputation(): void; - // For test suite - deps: { - (mockWindow: Window): Window; - factory: Object; - } + // For test suite + deps: { + (mockWindow: Window): Window; + factory: Object; + } } interface MithrilVirtualElement { - key?: number; - tag?: string; - attrs?: MithrilAttributes; - children?: any[]; + key?: number; + tag?: string; + attrs?: MithrilAttributes; + children?: any[]; } // Configuration function for an element interface MithrilElementConfig { - (element: Element, isInitialized: boolean, context?: any): void; + (element: Element, isInitialized: boolean, context?: any): void; } // Attributes on a virtual element interface MithrilAttributes { - title?: string; - className?: string; - class?: string; - config?: MithrilElementConfig; + title?: string; + className?: string; + class?: string; + config?: MithrilElementConfig; } // Defines the subset of Event that Mithril needs interface MithrilEvent { - currentTarget: Element; + currentTarget: Element; } interface MithrilController { - onunload?(evt: Event): any; + onunload?(evt: Event): any; } interface MithrilControllerFunction extends MithrilController { - (): any; + (): any; } interface MithrilView { - (ctrl: T): string|MithrilVirtualElement; + (ctrl: T): string|MithrilVirtualElement; } interface MithrilModule { - controller: MithrilControllerFunction|{ new(): T }; - view: MithrilView; + controller: MithrilControllerFunction|{ new(): T }; + view: MithrilView; } interface MithrilProperty { - (): T; - (value: T): T; - toJSON(): T; + (): T; + (value: T): T; + toJSON(): T; } interface MithrilPromiseProperty extends MithrilPromise { - (): T; - (value: T): T; - toJSON(): T; + (): T; + (value: T): T; + toJSON(): T; } interface MithrilRoutes { - [key: string]: MithrilModule; + [key: string]: MithrilModule; } interface MithrilDeferred { - resolve(value?: T): void; - reject(value?: any): void; - promise: MithrilPromise; + resolve(value?: T): void; + reject(value?: any): void; + promise: MithrilPromise; } interface MithrilSuccessCallback { - (value: T): U; - (value: T): MithrilPromise; + (value: T): U; + (value: T): MithrilPromise; } interface MithrilErrorCallback { - (value: Error): U; - (value: string): U; + (value: Error): U; + (value: string): U; } interface MithrilPromise { - (): T; - (value: T): T; - then(success: (value: T) => U): MithrilPromise; - then(success: (value: T) => MithrilPromise): MithrilPromise; - then(success: (value: T) => U, error: (value: Error) => V): MithrilPromise|MithrilPromise; - then(success: (value: T) => MithrilPromise, error: (value: Error) => V): MithrilPromise|MithrilPromise; + (): T; + (value: T): T; + then(success: (value: T) => U): MithrilPromise; + then(success: (value: T) => MithrilPromise): MithrilPromise; + then(success: (value: T) => U, error: (value: Error) => V): MithrilPromise|MithrilPromise; + then(success: (value: T) => MithrilPromise, error: (value: Error) => V): MithrilPromise|MithrilPromise; } interface MithrilXHROptions { - method?: string; - url: string; - user?: string; - password?: string; - data?: any; - background?: boolean; - unwrapSuccess?(data: any): any; - unwrapError?(data: any): any; - serialize?(dataToSerialize: any): string; - deserialize?(dataToDeserialize: string): any; - extract?(xhr: XMLHttpRequest, options: MithrilXHROptions): string; - type?(data: Object): void; - config?(xhr: XMLHttpRequest, options: MithrilXHROptions): XMLHttpRequest; - dataType?: string; + method?: string; + url: string; + user?: string; + password?: string; + data?: any; + background?: boolean; + unwrapSuccess?(data: any): any; + unwrapError?(data: any): any; + serialize?(dataToSerialize: any): string; + deserialize?(dataToDeserialize: string): any; + extract?(xhr: XMLHttpRequest, options: MithrilXHROptions): string; + type?(data: Object): void; + config?(xhr: XMLHttpRequest, options: MithrilXHROptions): XMLHttpRequest; + dataType?: string; } declare var Mithril: MithrilStatic; declare var m: MithrilStatic; declare module 'mithril' { - export = m; + export = m; }