-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Describe the problem
Typescript's intellisense lists every single function prototype property on runes:
This makes it difficult to see the actual useful properties (frozen
, snapshot
) and allows you to write things like
$state.bind(this);
without Typescript complaining.
Describe the proposed solution
The type definitions can be updated like so:
declare const $state: {
/** @deprecated */
apply: never;
/** @deprecated */
arguments: never;
/** @deprecated */
bind: never;
/** @deprecated */
call: never;
/** @deprecated */
caller: never;
/** @deprecated */
length: never;
/** @deprecated */
name: never;
/** @deprecated */
prototype: never;
/** @deprecated */
toString: never;
<T>(initial: T): T;
<T>(): T | undefined;
frozen<T>(initial: T): Readonly<T>;
frozen<T>(): Readonly<T> | undefined;
snapshot<T>(state: T): T;
};
which makes intellisense look like this:
(note that I explored a few ways of achieving this and it seems fairly delicate)
Importance
would make my life easier
max-got and svelte-kit-so-goodAdrianGonz97
Metadata
Metadata
Assignees
Labels
No labels