|
| 1 | +/* eslint-disable */ |
| 2 | +// Auto-generated, do not change |
| 3 | +// prettier-ignore |
| 4 | +export const svelteShims = `declare class Svelte2TsxComponent< |
| 5 | + Props extends {} = {}, |
| 6 | + Events extends {} = {}, |
| 7 | + Slots extends {} = {} |
| 8 | +> { |
| 9 | + // svelte2tsx-specific |
| 10 | + /** |
| 11 | + * @internal This is for type checking capabilities only |
| 12 | + * and does not exist at runtime. Don't use this property. |
| 13 | + */ |
| 14 | + $$prop_def: Props; |
| 15 | + /** |
| 16 | + * @internal This is for type checking capabilities only |
| 17 | + * and does not exist at runtime. Don't use this property. |
| 18 | + */ |
| 19 | + $$events_def: Events; |
| 20 | + /** |
| 21 | + * @internal This is for type checking capabilities only |
| 22 | + * and does not exist at runtime. Don't use this property. |
| 23 | + */ |
| 24 | + $$slot_def: Slots; |
| 25 | + // https://svelte.dev/docs#Client-side_component_API |
| 26 | + constructor(options: Svelte2TsxComponentConstructorParameters<Props>); |
| 27 | + /** |
| 28 | + * Causes the callback function to be called whenever the component dispatches an event. |
| 29 | + * A function is returned that will remove the event listener when called. |
| 30 | + */ |
| 31 | + $on<K extends keyof Events & string>(event: K, handler: (e: Events[K]) => any): () => void; |
| 32 | + /** |
| 33 | + * Removes a component from the DOM and triggers any \`onDestroy\` handlers. |
| 34 | + */ |
| 35 | + $destroy(): void; |
| 36 | + /** |
| 37 | + * Programmatically sets props on an instance. |
| 38 | + * \`component.$set({ x: 1 })\` is equivalent to \`x = 1\` inside the component's \`<script>\` block. |
| 39 | + * Calling this method schedules an update for the next microtask — the DOM is __not__ updated synchronously. |
| 40 | + */ |
| 41 | + $set(props?: Partial<Props>): void; |
| 42 | + // From SvelteComponent(Dev) definition |
| 43 | + $$: any; |
| 44 | + $capture_state(): void; |
| 45 | + $inject_state(): void; |
| 46 | +} |
| 47 | +
|
| 48 | +interface Svelte2TsxComponentConstructorParameters<Props extends {}> { |
| 49 | + /** |
| 50 | + * An HTMLElement to render to. This option is required. |
| 51 | + */ |
| 52 | + target: Element; |
| 53 | + /** |
| 54 | + * A child of \`target\` to render the component immediately before. |
| 55 | + */ |
| 56 | + anchor?: Element; |
| 57 | + /** |
| 58 | + * An object of properties to supply to the component. |
| 59 | + */ |
| 60 | + props?: Props; |
| 61 | + hydrate?: boolean; |
| 62 | + intro?: boolean; |
| 63 | + $$inline?: boolean; |
| 64 | +} |
| 65 | +
|
| 66 | +type AConstructorTypeOf<T, U extends any[] = any[]> = new (...args: U) => T; |
| 67 | +type SvelteComponentConstructor<T, U extends Svelte2TsxComponentConstructorParameters<any>> = new (options: U) => T; |
| 68 | +
|
| 69 | +type SvelteActionReturnType = { |
| 70 | + update?: (args: any) => void, |
| 71 | + destroy?: () => void |
| 72 | +} | void |
| 73 | +
|
| 74 | +type SvelteTransitionConfig = { |
| 75 | + delay?: number, |
| 76 | + duration?: number, |
| 77 | + easing?: (t: number) => number, |
| 78 | + css?: (t: number, u: number) => string, |
| 79 | + tick?: (t: number, u: number) => void |
| 80 | +} |
| 81 | +
|
| 82 | +type SvelteTransitionReturnType = SvelteTransitionConfig | (() => SvelteTransitionConfig) |
| 83 | +
|
| 84 | +type SvelteAnimationReturnType = { |
| 85 | + delay?: number, |
| 86 | + duration?: number, |
| 87 | + easing?: (t: number) => number, |
| 88 | + css?: (t: number, u: number) => string, |
| 89 | + tick?: (t: number, u: number) => void |
| 90 | +} |
| 91 | +
|
| 92 | +type SvelteWithOptionalProps<Props, Keys extends keyof Props> = Omit<Props, Keys> & Partial<Pick<Props, Keys>>; |
| 93 | +type SvelteAllProps = { [index: string]: any } |
| 94 | +type SveltePropsAnyFallback<Props> = {[K in keyof Props]: Props[K] extends undefined ? any : Props[K]} |
| 95 | +type SvelteRestProps = { [index: string]: any } |
| 96 | +type SvelteSlots = { [index: string]: any } |
| 97 | +type SvelteStore<T> = { subscribe: (run: (value: T) => any, invalidate?: any) => any } |
| 98 | +
|
| 99 | +// Forces TypeScript to look into the type which results in a better representation of it |
| 100 | +// which helps for error messages |
| 101 | +type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; |
| 102 | +
|
| 103 | +declare var process: NodeJS.Process & { browser: boolean } |
| 104 | +declare var __sveltets_AnimationMove: { from: DOMRect, to: DOMRect } |
| 105 | +
|
| 106 | +declare function __sveltets_ensureAnimation(animationCall: SvelteAnimationReturnType): {}; |
| 107 | +declare function __sveltets_ensureAction(actionCall: SvelteActionReturnType): {}; |
| 108 | +declare function __sveltets_ensureTransition(transitionCall: SvelteTransitionReturnType): {}; |
| 109 | +declare function __sveltets_ensureFunction(expression: (e: Event & { detail?: any }) => unknown ): {}; |
| 110 | +declare function __sveltets_ensureType<T>(type: AConstructorTypeOf<T>, el: T): {}; |
| 111 | +declare function __sveltets_cssProp(prop: Record<string, any>): {}; |
| 112 | +declare function __sveltets_ctorOf<T>(type: T): AConstructorTypeOf<T>; |
| 113 | +declare function __sveltets_instanceOf<T = any>(type: AConstructorTypeOf<T>): T; |
| 114 | +declare function __sveltets_allPropsType(): SvelteAllProps |
| 115 | +declare function __sveltets_restPropsType(): SvelteRestProps |
| 116 | +declare function __sveltets_slotsType<Slots, Key extends keyof Slots>(slots: Slots): Record<Key, boolean>; |
| 117 | +
|
| 118 | +// Overload of the following two functions is necessary. |
| 119 | +// An empty array of optionalProps makes OptionalProps type any, which means we lose the prop typing. |
| 120 | +// optionalProps need to be first or its type cannot be infered correctly. |
| 121 | +
|
| 122 | +declare function __sveltets_partial<Props = {}, Events = {}, Slots = {}>( |
| 123 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 124 | +): {props?: SveltePropsAnyFallback<Props>, events?: Events, slots?: Slots } |
| 125 | +declare function __sveltets_partial<Props = {}, Events = {}, Slots = {}, OptionalProps extends keyof Props = any>( |
| 126 | + optionalProps: OptionalProps[], |
| 127 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 128 | +): {props?: Expand<SvelteWithOptionalProps<SveltePropsAnyFallback<Props>, OptionalProps>>, events?: Events, slots?: Slots } |
| 129 | +
|
| 130 | +declare function __sveltets_partial_with_any<Props = {}, Events = {}, Slots = {}>( |
| 131 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 132 | +): {props?: SveltePropsAnyFallback<Props> & SvelteAllProps, events?: Events, slots?: Slots } |
| 133 | +declare function __sveltets_partial_with_any<Props = {}, Events = {}, Slots = {}, OptionalProps extends keyof Props = any>( |
| 134 | + optionalProps: OptionalProps[], |
| 135 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 136 | +): {props?: Expand<SvelteWithOptionalProps<SveltePropsAnyFallback<Props>, OptionalProps>> & SvelteAllProps, events?: Events, slots?: Slots } |
| 137 | +
|
| 138 | +
|
| 139 | +declare function __sveltets_with_any<Props = {}, Events = {}, Slots = {}>( |
| 140 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 141 | +): {props?: Props & SvelteAllProps, events?: Events, slots?: Slots } |
| 142 | +
|
| 143 | +declare function __sveltets_with_any_event<Props = {}, Events = {}, Slots = {}>( |
| 144 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 145 | +): {props?: Props, events?: Events & {[evt: string]: CustomEvent<any>;}, slots?: Slots } |
| 146 | +
|
| 147 | +declare function __sveltets_store_get<T = any>(store: SvelteStore<T>): T |
| 148 | +declare function __sveltets_any(dummy: any): any; |
| 149 | +declare function __sveltets_empty(dummy: any): {}; |
| 150 | +declare function __sveltets_componentType(): AConstructorTypeOf<Svelte2TsxComponent<any, any, any>> |
| 151 | +declare function __sveltets_invalidate<T>(getValue: () => T): T |
| 152 | +
|
| 153 | +declare function __sveltets_mapWindowEvent<K extends keyof HTMLBodyElementEventMap>( |
| 154 | + event: K |
| 155 | +): HTMLBodyElementEventMap[K]; |
| 156 | +declare function __sveltets_mapBodyEvent<K extends keyof WindowEventMap>( |
| 157 | + event: K |
| 158 | +): WindowEventMap[K]; |
| 159 | +declare function __sveltets_mapElementEvent<K extends keyof HTMLElementEventMap>( |
| 160 | + event: K |
| 161 | +): HTMLElementEventMap[K]; |
| 162 | +declare function __sveltets_mapElementTag<K extends keyof ElementTagNameMap>( |
| 163 | + tag: K |
| 164 | +): ElementTagNameMap[K]; |
| 165 | +declare function __sveltets_mapElementTag<K extends keyof SVGElementTagNameMap>( |
| 166 | + tag: K |
| 167 | +): SVGElementTagNameMap[K]; |
| 168 | +declare function __sveltets_mapElementTag( |
| 169 | + tag: any |
| 170 | +): HTMLElement; |
| 171 | +
|
| 172 | +declare function __sveltets_bubbleEventDef<Events, K extends keyof Events>( |
| 173 | + events: Events, eventKey: K |
| 174 | +): Events[K]; |
| 175 | +declare function __sveltets_bubbleEventDef( |
| 176 | + events: any, eventKey: string |
| 177 | +): any; |
| 178 | +
|
| 179 | +declare const __sveltets_customEvent: CustomEvent<any>; |
| 180 | +declare function __sveltets_toEventTypings<Typings>(): {[Key in keyof Typings]: CustomEvent<Typings[Key]>}; |
| 181 | +
|
| 182 | +declare function __sveltets_unionType<T1, T2>(t1: T1, t2: T2): T1 | T2; |
| 183 | +declare function __sveltets_unionType<T1, T2, T3>(t1: T1, t2: T2, t3: T3): T1 | T2 | T3; |
| 184 | +declare function __sveltets_unionType<T1, T2, T3, T4>(t1: T1, t2: T2, t3: T3, t4: T4): T1 | T2 | T3 | T4; |
| 185 | +declare function __sveltets_unionType(...types: any[]): any; |
| 186 | +
|
| 187 | +declare function __sveltets_awaitThen<T>( |
| 188 | + promise: T, |
| 189 | + onfulfilled: (value: T extends PromiseLike<infer U> ? U : T) => any, |
| 190 | + onrejected?: (value: T extends PromiseLike<any> ? any : never) => any |
| 191 | +): any; |
| 192 | +
|
| 193 | +declare function __sveltets_each<T>( |
| 194 | + array: ArrayLike<T>, |
| 195 | + callbackfn: (value: T, index: number) => any |
| 196 | +): any; |
| 197 | +
|
| 198 | +declare function createSvelte2TsxComponent<Props, Events, Slots>( |
| 199 | + render: {props?: Props, events?: Events, slots?: Slots } |
| 200 | +): SvelteComponentConstructor<Svelte2TsxComponent<Props, Events, Slots>,Svelte2TsxComponentConstructorParameters<Props>>; |
| 201 | +
|
| 202 | +declare function __sveltets_unwrapArr<T>(arr: ArrayLike<T>): T |
| 203 | +declare function __sveltets_unwrapPromiseLike<T>(promise: PromiseLike<T> | T): T |
| 204 | +`; |
0 commit comments