-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional type parameter to the get tag
- Loading branch information
1 parent
408f711
commit 87c09f8
Showing
2 changed files
with
8 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@marko/tags-api-preview": patch | ||
--- | ||
|
||
Improve get tag type by accepting an optional type parameter that specifies the returned value type |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export interface Input { | ||
// @ts-expect-error 'VariableType' is declared but its value is never read. (It is only used to set the type of the return) | ||
export interface Input<VariableType = unknown> { | ||
value: string; | ||
} | ||
|
||
// TODO: this could be better. | ||
return = 1 as unknown; | ||
return = 1 as VariableType; |