svelte2tsx
Advanced tools
Comparing version 0.5.3 to 0.5.4
{ | ||
"name": "svelte2tsx", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"description": "Convert Svelte components to TSX for type checking", | ||
@@ -5,0 +5,0 @@ "author": "David Pershouse", |
@@ -259,4 +259,37 @@ // Whenever a ambient declaration changes, its number should be increased | ||
declare function __sveltets_2_ensureComponent<T extends new (args: {target: any, props?: any}) => Svelte2TsxComponent<any, {}, any>>(type: T): T extends never ? Svelte2TsxComponent<any, any, any> : T; | ||
// The following is necessary because there are two clashing errors that can't be solved at the same time | ||
// when using Svelte2TsxComponent, more precisely the event typings in | ||
// __sveltets_2_ensureComponent<T extends new (..) => Svelte2TsxComponent<any,||any||<-this,any>>(type: T): T; | ||
// If we type it as "any", we have an error when using sth like {a: CustomEvent<any>} | ||
// If we type it as "{}", we have an error when using sth like {[evt: string]: CustomEvent<any>} | ||
// If we type it as "unknown", we get all kinds of follow up errors which we want to avoid | ||
// Therefore introduce two more base classes just for this case. | ||
/** | ||
* Ambient type only used for intellisense, DO NOT USE IN YOUR PROJECT | ||
*/ | ||
declare type ATypedSvelteComponent = { | ||
/** | ||
* @internal This is for type checking capabilities only | ||
* and does not exist at runtime. Don't use this property. | ||
*/ | ||
$$prop_def: any; | ||
/** | ||
* @internal This is for type checking capabilities only | ||
* and does not exist at runtime. Don't use this property. | ||
*/ | ||
$$events_def: any; | ||
/** | ||
* @internal This is for type checking capabilities only | ||
* and does not exist at runtime. Don't use this property. | ||
*/ | ||
$$slot_def: any; | ||
$on(event: string, handler: (e: any) => any): () => void; | ||
} | ||
/** | ||
* Ambient type only used for intellisense, DO NOT USE IN YOUR PROJECT | ||
*/ | ||
declare type ConstructorOfATypedSvelteComponent = new (args: {target: any, props?: any}) => ATypedSvelteComponent | ||
declare function __sveltets_2_ensureComponent<T extends ConstructorOfATypedSvelteComponent>(type: T): T; | ||
declare function __sveltets_2_ensureArray<T extends ArrayLike<unknown>>(array: T): T extends ArrayLike<infer U> ? U[] : any[]; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
674711
15848