From 1999c4ad6a4a3a4966dc2695526eb3e06db1b6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Wi=C3=9Fler?= Date: Sun, 11 Mar 2018 11:40:36 +0100 Subject: [PATCH] Update ts declare file, to be valid (#37) * Update ts declare file, to be valid * Update ts declare file, to represent access model + Resolve typo --- Slim.d.ts | 138 +++++++++++++++++++++++++++--------------------------- 1 file changed, 68 insertions(+), 70 deletions(-) diff --git a/Slim.d.ts b/Slim.d.ts index b59913d..708ccee 100644 --- a/Slim.d.ts +++ b/Slim.d.ts @@ -15,12 +15,12 @@ export declare interface SlimInternals { } export declare class Slim extends HTMLElement { - - static dashToCamel(dash: string):string; - static camelToDash(camel: string):string; - static get rxInject(): RegExp; - static get rxProp(): RegExp; - static get rxMethod(): RegExp; + + protected static dashToCamel(dash: string):string; + protected static camelToDash(camel: string):string; + static rxInject(): RegExp; + static rxProp(): RegExp; + static rxMethod(): RegExp; static lookup(target:object|Element, expression: string, maybeRepeater:Element):any; static _$ (target: Element): SlimInternals; @@ -38,7 +38,7 @@ export declare class Slim extends HTMLElement { static createUniqueIndex (): string; - static plugin ( + public static plugin ( phase: string, plugin: (target: Slim) => void ): void; @@ -52,89 +52,87 @@ export declare class Slim extends HTMLElement { directiveFn: (source:Slim, child:Element, attribute: Attr, match: any) => void, isBlocking: boolean ): void; - - static executePlugins (phase: string, target: Slim):void; - + + private static executePlugins (phase: string, target: Slim):void; + static qSelectAll(target: Element, selector: string):Array; - + static unbind (source: Element, target: Element): void; - + static root (target:Element): Element | ShadowRoot; - + static selectRecursive (target: Element, force: boolean): Array; - - static removeChild (target: Element): void; - + static moveChildren (source: Element, target: Element); - - static wrapGetterSetter (element: Element, expression: string): string; - - static bindOwn (source:Element, expression: string, executor: function): function; - - static bind (source:Element, target: Element, expression: string, executor: function): function; - - static update (target: Element, ...props: string): void; - + + private static wrapGetterSetter (element: Element, expression: string): string; + + static bindOwn (source:Element, expression: string, executor: Function): Function; + + static bind (source:Element, target: Element, expression: string, executor: Function): Function; + + static update (target: Element, ...props: string[]): void; + static commit (target: Element, prop: string); - + static readonly uniqueIndex: number; - + static readonly tagToClassDict: Map; - + static readonly tagToTemplateDict: Map; - + static readonly plugins: { create: Array<(target: Slim) => void>, added: Array<(target: Slim) => void>, beforeRender: Array<(target: Slim) => void>, afterRender: Array<(target: Slim) => void>, removed: Array<(target: Slim) => void>, - } - - static debug: function; - - static asap(f: function): any; - - protected createdCallback () {} - - protected connectedCallback() {} - - protected disconnectedCallback() {} - - protected attributeChangedCallback() {} - - protected get _isInContext(): boolean; - + }; + + static debug: Function; + + static asap(f: Function): any; + + protected createdCallback (): void + + protected connectedCallback(): void + + protected disconnectedCallback(): void + + protected attributeChangedCallback(): void + + protected _isInContext(): boolean; + protected _executeBindings(prop?: string): void; - - protected _bindChildren(children: Array|NodeList): void; - + + protected _bindChildren(children: Array| NodeListOf): void; + protected _resetBindings(): void; - + protected _render (customTemplate?: string): void; - + protected _initialize (): void; - - public commit (...args: string): void; - - public update (...args: string): void; - - public render (customTempalte: string): void; - - protected onRender() {}; - protected onBeforeCreated() {}; - protected onCreated() {}; - protected onAdded() {}; - protected onRemoved() {}; - + + public commit (...args: string[]): void; + + public update (...args: string[]): void; + + public render (customTemplate: string): void; + + protected onRender(): void; + protected onBeforeCreated(): void; + protected onCreated(): void; + protected onAdded(): void; + protected onRemoved(): void; + public find (selector: string): Element; - - public findAll (selector: string): Array|NodeList; - + + public findAll (selector: string): Array| NodeListOf; + protected callAttribute (attr: string, data: any): any; - get useShadow (): boolean; - - get template (): string; -}; + useShadow (): boolean; + + template (): string; +}