index.d.ts
        
        
            
                    89 lines
            
             | 3.0 KiB
            
                | video/mp2t
            
             |
                TypeScriptLexer
            
          
        |  | r109 | // eslint-disable-next-line @typescript-eslint/triple-slash-reference | |
|  | r97 | /// <reference path="./css-plugin.d.ts"/> | |
|  | r65 | ||
|  | r129 | import _WidgetBase = require("dijit/_WidgetBase"); | |
|  | r109 | import { Rendition } from "./tsx/traits"; | |
|  | r96 | ||
|  | r109 | declare global { | |
| namespace JSX { | |||
| type Ref<T> = ((value: T | undefined) => void); | |||
|  | r129 | type Element = Rendition | _WidgetBase; | |
|  | r65 | ||
|  | r109 | interface DjxIntrinsicAttributes<E> { | |
| /** alias for className */ | |||
| class?: string; | |||
|  | r65 | ||
|  | r109 | /** specifies the name of the property in the widget where the the | |
| * reference to the current object will be stored | |||
| */ | |||
| "data-dojo-attach-point"?: string; | |||
|  | r65 | ||
|  | r109 | /** specifies handlers map for the events */ | |
| "data-dojo-attach-event"?: string; | |||
|  | r96 | ||
|  | r109 | ref?: Ref<E>; | |
|  | r65 | ||
|  | r109 | /** @deprecated */ | |
| [attr: string]: unknown; | |||
| } | |||
|  | r65 | ||
|  | r109 | // eslint-disable-next-line @typescript-eslint/no-empty-interface | |
| interface DjxIntrinsicElements { | |||
| } | |||
| type RecursivePartial<T> = T extends string | number | boolean | null | undefined | ((...args: unknown[]) => unknown) ? | |||
| T : | |||
| { [k in keyof T]?: RecursivePartial<T[k]> }; | |||
|  | r65 | ||
|  | r109 | type MatchingMemberKeys<T, U> = { | |
| [K in keyof T]: T[K] extends U ? K : never; | |||
| }[keyof T]; | |||
| type NotMatchingMemberKeys<T, U> = { | |||
| [K in keyof T]: T[K] extends U ? never : K; | |||
| }[keyof T]; | |||
|  | r65 | ||
|  | r109 | type ExtractMembers<T, U> = Pick<T, MatchingMemberKeys<T, U>>; | |
|  | r65 | ||
|  | r109 | type ExcludeMembers<T, U> = Pick<T, NotMatchingMemberKeys<T, U>>; | |
|  | r65 | ||
|  | r109 | type ElementAttrNames<E> = NotMatchingMemberKeys<E, (...args: unknown[]) => unknown>; | |
|  | r65 | ||
|  | r109 | type ElementAttrType<E, K extends string | symbol> = K extends keyof E ? RecursivePartial<E[K]> : string; | |
|  | r65 | ||
|  | r109 | type ElementAttrNamesBlacklist = "children" | "getRootNode" | keyof EventTarget; | |
|  | r65 | ||
|  | r109 | /** This type extracts keys of the specified parameter E by the following rule: | |
| * 1. skips all ElementAttrNamesBlacklist | |||
| * 2. skips all methods except with the signature of event handlers | |||
| */ | |||
| type AssignableElementAttrNames<E> = { | |||
| [K in keyof E]: K extends ElementAttrNamesBlacklist ? never : | |||
| ((evt: Event) => unknown) extends E[K] ? K : | |||
| E[K] extends ((...args: unknown[]) => unknown) ? never : | |||
|  | r65 | K; | |
|  | r109 | }[keyof E]; | |
|  | r65 | ||
|  | r109 | type LaxElement<E extends object> = | |
| RecursivePartial<Pick<E, AssignableElementAttrNames<E>>> & | |||
| DjxIntrinsicAttributes<E>; | |||
|  | r65 | ||
|  | r109 | type LaxIntrinsicElementsMap = { | |
| [tag in keyof HTMLElementTagNameMap]: LaxElement<HTMLElementTagNameMap[tag]> | |||
| } & DjxIntrinsicElements; | |||
|  | r65 | ||
|  | r109 | type IntrinsicElements = { | |
| [tag in keyof LaxIntrinsicElementsMap]: LaxIntrinsicElementsMap[tag]; | |||
| }; | |||
|  | r96 | ||
|  | r109 | interface ElementChildrenAttribute { | |
| children: unknown; | |||
| } | |||
|  | r96 | ||
|  | r109 | interface IntrinsicClassAttributes<T> { | |
| ref?: Ref<T>; | |||
| children?: unknown; | |||
| } | |||
|  | r96 | } | |
|  | r109 | } | 
