feat: add WeakRef interface
This commit is contained in:
parent
335c5ee25f
commit
4fe89357fc
3 changed files with 98 additions and 2 deletions
86
.idea/workspace.xml
generated
Normal file
86
.idea/workspace.xml
generated
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="df737647-19a6-4a5f-88a0-8ce9d29a36c8" name="Changes" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/source/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/source/index.ts" afterDir="false" />
|
||||||
|
</list>
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="MacroExpansionManager">
|
||||||
|
<option name="directoryName" value="hl7nkx35" />
|
||||||
|
</component>
|
||||||
|
<component name="MarkdownSettingsMigration">
|
||||||
|
<option name="stateVersion" value="1" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectId" id="25cK4TvoIxGKxbzN8247wytmhpC" />
|
||||||
|
<component name="ProjectViewState">
|
||||||
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
|
<option name="showLibraryContents" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
|
"keyToString": {
|
||||||
|
"WebServerToolWindowFactoryState": "false",
|
||||||
|
"last_opened_file_path": "/Users/wangbinlin/Project/daily_exercise/is",
|
||||||
|
"nodejs_package_manager_path": "npm",
|
||||||
|
"ts.external.directory.path": "/Users/wangbinlin/Project/daily_exercise/is/node_modules/typescript/lib",
|
||||||
|
"vue.rearranger.settings.migration": "true"
|
||||||
|
}
|
||||||
|
}]]></component>
|
||||||
|
<component name="RunManager" selected="Node.js.index.js">
|
||||||
|
<configuration name="index.js" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/source/index.js" working-dir="$PROJECT_DIR$/source">
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
<configuration name="test.js" type="NodeJSConfigurationType" temporary="true" nameIsGenerated="true" path-to-js-file="$PROJECT_DIR$/test/test.js" working-dir="$PROJECT_DIR$/test">
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
<recent_temporary>
|
||||||
|
<list>
|
||||||
|
<item itemvalue="Node.js.index.js" />
|
||||||
|
<item itemvalue="Node.js.test.js" />
|
||||||
|
</list>
|
||||||
|
</recent_temporary>
|
||||||
|
</component>
|
||||||
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="df737647-19a6-4a5f-88a0-8ce9d29a36c8" name="Changes" comment="" />
|
||||||
|
<created>1645820743983</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1645820743983</updated>
|
||||||
|
<workItem from="1645820745885" duration="3571000" />
|
||||||
|
<workItem from="1645962952689" duration="7278000" />
|
||||||
|
<workItem from="1646150741729" duration="7294000" />
|
||||||
|
<workItem from="1646315541343" duration="840000" />
|
||||||
|
<workItem from="1646820573494" duration="13927000" />
|
||||||
|
<workItem from="1654745859867" duration="730000" />
|
||||||
|
<workItem from="1654783293999" duration="13454000" />
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
|
<option name="version" value="3" />
|
||||||
|
<option name="exactExcludedFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/source/index.js" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="Vcs.Log.Tabs.Properties">
|
||||||
|
<option name="TAB_STATES">
|
||||||
|
<map>
|
||||||
|
<entry key="MAIN">
|
||||||
|
<value>
|
||||||
|
<State />
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
@ -612,8 +612,8 @@ export const assert: Assert = {
|
||||||
},
|
},
|
||||||
buffer: (value: unknown): asserts value is Buffer => assertType(is.buffer(value), 'Buffer', value),
|
buffer: (value: unknown): asserts value is Buffer => assertType(is.buffer(value), 'Buffer', value),
|
||||||
blob: (value: unknown): asserts value is Blob => assertType(is.blob(value), 'Blob', value),
|
blob: (value: unknown): asserts value is Blob => assertType(is.blob(value), 'Blob', value),
|
||||||
nullOrUndefined: /* eslint-disable-line @typescript-eslint/ban-types */ (value: unknown): asserts value is null | undefined => assertType(is.nullOrUndefined(value), AssertionTypeDescription.nullOrUndefined, value),
|
nullOrUndefined: (value: unknown): asserts value is null | undefined => assertType(is.nullOrUndefined(value), AssertionTypeDescription.nullOrUndefined, value),
|
||||||
object: (value: unknown): asserts value is Record<string, unknown> => assertType(is.object(value), 'Object', value),
|
object: (value: unknown): asserts value is object => assertType(is.object(value), 'Object', value),
|
||||||
iterable: <T = unknown>(value: unknown): asserts value is Iterable<T> => assertType(is.iterable(value), AssertionTypeDescription.iterable, value),
|
iterable: <T = unknown>(value: unknown): asserts value is Iterable<T> => assertType(is.iterable(value), AssertionTypeDescription.iterable, value),
|
||||||
asyncIterable: <T = unknown>(value: unknown): asserts value is AsyncIterable<T> => assertType(is.asyncIterable(value), AssertionTypeDescription.asyncIterable, value),
|
asyncIterable: <T = unknown>(value: unknown): asserts value is AsyncIterable<T> => assertType(is.asyncIterable(value), AssertionTypeDescription.asyncIterable, value),
|
||||||
generator: (value: unknown): asserts value is Generator => assertType(is.generator(value), 'Generator', value),
|
generator: (value: unknown): asserts value is Generator => assertType(is.generator(value), 'Generator', value),
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,13 @@ export interface ObservableLike {
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||||
export type Falsy = false | 0 | 0n | '' | null | undefined;
|
export type Falsy = false | 0 | 0n | '' | null | undefined;
|
||||||
|
|
||||||
|
export interface WeakRef<T extends object> {
|
||||||
|
readonly [Symbol.toStringTag]: "WeakRef";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the WeakRef instance's target object, or undefined if the target object has been
|
||||||
|
* reclaimed.
|
||||||
|
*/
|
||||||
|
deref(): T | undefined;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue