Skip to content

Commit

Permalink
Merge pull request #698 from adopted-ember-addons/helper-types
Browse files Browse the repository at this point in the history
Provide types for helpers named exports for .gts support
  • Loading branch information
SergeAstapov authored Nov 9, 2024
2 parents 4f1c74e + 72d6317 commit 6219bca
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/plan-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
with:
node-version: 18
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install --frozen-lockfile
- name: "Generate Explanation and Prep Changelogs"
id: explanation
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install --frozen-lockfile
- name: npm publish
run: pnpm release-plan publish
Expand Down
1 change: 0 additions & 1 deletion ember-changeset/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
/.template-lintrc.js
/.travis.yml
/.watchmanconfig
/CODE_OF_CONDUCT.md
/CONTRIBUTING.md
/ember-cli-build.js
/testem.js
Expand Down
15 changes: 15 additions & 0 deletions ember-changeset/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { BufferedChangeset } from 'validated-changeset';
import type { HelperLike } from '@glint/template';

type BufferedChangesetConstructorParameters = ConstructorParameters<typeof BufferedChangeset>;

Expand All @@ -14,3 +15,17 @@ type changesetFunctionsParameters = [
export class EmberChangeset extends BufferedChangeset {}
export function changeset(...args: changesetFunctionsParameters): EmberChangeset;
export function Changeset(...args: changesetFunctionsParameters): EmberChangeset;

type changesetGet = HelperLike<{
Args: {
Positional: [changeset: BufferedChangeset | EmberChangeset, fieldPath: string];
};
Return: unknown;
}>;

type changesetSet = HelperLike<{
Args: {
Positional: [changeset: BufferedChangeset | EmberChangeset, fieldPath: string];
};
Return: (value: unknown) => void;
}>;

0 comments on commit 6219bca

Please sign in to comment.