-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from emberjs/types
Introduce type definitions for render modifiers
- Loading branch information
Showing
9 changed files
with
83 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ | |
/package.json.ember-try | ||
/package-lock.json.ember-try | ||
/yarn.lock.ember-try | ||
|
||
# types | ||
/types/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ModifierLike } from '@glint/template'; | ||
|
||
export type RenderModifier<El extends Element, Args extends Array<any>> = InstanceType< | ||
ModifierLike<{ | ||
Element: El; | ||
Args: { | ||
Positional: [callback: (element: El, args: Args) => unknown, ...callbackArgs: Args]; | ||
}; | ||
}> | ||
>; |
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,8 @@ | ||
import { RenderModifier } from '../-private'; | ||
|
||
declare const didInsert: abstract new < | ||
El extends Element, | ||
Args extends Array<any> | ||
>() => RenderModifier<El, Args>; | ||
|
||
export default didInsert; |
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,8 @@ | ||
import { RenderModifier } from '../-private'; | ||
|
||
declare const didUpdate: abstract new < | ||
El extends Element, | ||
Args extends Array<any> | ||
>() => RenderModifier<El, Args>; | ||
|
||
export default didUpdate; |
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,8 @@ | ||
import { RenderModifier } from '../-private'; | ||
|
||
declare const willDestroy: abstract new < | ||
El extends Element, | ||
Args extends Array<any> | ||
>() => RenderModifier<El, Args>; | ||
|
||
export default willDestroy; |
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,9 @@ | ||
import type didInsert from './modifiers/did-insert'; | ||
import type didUpdate from './modifiers/did-update'; | ||
import type willDestroy from './modifiers/will-destroy'; | ||
|
||
export default interface RenderModifiersRegistry { | ||
'did-insert': typeof didInsert; | ||
'did-update': typeof didUpdate; | ||
'will-destroy': typeof willDestroy; | ||
} |
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