Changeset 79a0317 for imaps-frontend/node_modules/side-channel/index.d.ts
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/side-channel/index.d.ts
r0c6b92a r79a0317 1 import getSideChannelList from 'side-channel-list'; 2 import getSideChannelMap from 'side-channel-map'; 3 import getSideChannelWeakMap from 'side-channel-weakmap'; 4 1 5 declare namespace getSideChannel { 2 type Key = unknown; 3 type ListNode<T> = { 4 key: Key; 5 next: ListNode<T>; 6 value: T; 7 }; 8 type RootNode<T> = { 9 key: object; 10 next: null | ListNode<T>; 11 }; 12 function listGetNode<T>(list: RootNode<T>, key: ListNode<T>['key']): ListNode<T> | void; 13 function listGet<T>(objects: RootNode<T>, key: ListNode<T>['key']): T | void; 14 function listSet<T>(objects: RootNode<T>, key: ListNode<T>['key'], value: T): void; 15 function listHas<T>(objects: RootNode<T>, key: ListNode<T>['key']): boolean; 16 17 type Channel = { 18 assert: (key: Key) => void; 19 has: (key: Key) => boolean; 20 get: <T>(key: Key) => T; 21 set: <T>(key: Key, value: T) => void; 22 } 6 type Channel<K, V> = 7 | getSideChannelList.Channel<K, V> 8 | ReturnType<Exclude<typeof getSideChannelMap<K, V>, false>> 9 | ReturnType<Exclude<typeof getSideChannelWeakMap<K, V>, false>>; 23 10 } 24 11 25 declare function getSideChannel (): getSideChannel.Channel;12 declare function getSideChannel<K, V>(): getSideChannel.Channel<K, V>; 26 13 27 14 export = getSideChannel;
Note:
See TracChangeset
for help on using the changeset viewer.