-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hooks):
GlobalPreloadHookContext
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
21c7198
commit e50a12d
Showing
6 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @file Type Tests - GlobalPreloadHookContext | ||
* @module esm-types/hooks/tests/unit-d/GlobalPreloadHookContext | ||
*/ | ||
|
||
import type { MessagePort } from 'node:worker_threads' | ||
import type TestSubject from '../global-preload-context' | ||
|
||
describe('unit-d:hooks/GlobalPreloadHookContext', () => { | ||
it('should match [port: MessagePort]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('port') | ||
.toEqualTypeOf<MessagePort>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* @file Hooks - GlobalPreloadHookContext | ||
* @module esm-types/hooks/GlobalPreloadHookContext | ||
*/ | ||
|
||
import type { MessagePort } from 'node:worker_threads' | ||
|
||
/** | ||
* [`globalPreload`][1] hook context. | ||
* | ||
* [1]: https://nodejs.org/api/esm.html#globalpreload | ||
*/ | ||
interface GlobalPreloadHookContext { | ||
/** | ||
* {@linkcode MessagePort} to allow communication between the application and | ||
* the loader. | ||
*/ | ||
port: MessagePort | ||
} | ||
|
||
export type { GlobalPreloadHookContext as default } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters