Skip to content

Commit

Permalink
Add optional type parameter to the get tag
Browse files Browse the repository at this point in the history
  • Loading branch information
svallory authored and DylanPiercey committed Feb 26, 2024
1 parent 408f711 commit 87c09f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-moose-fold.md
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
6 changes: 3 additions & 3 deletions src/components/get/index.d.marko
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;

0 comments on commit 87c09f8

Please sign in to comment.