diff --git a/documents/modifier.md b/documents/modifier.md index dfebc11..409adc4 100644 --- a/documents/modifier.md +++ b/documents/modifier.md @@ -34,7 +34,7 @@ export default class [[name]] extends Modifier { [[name := camel(inputs.name)-]] [[signature := (pascal(inputs.name) + "Signature")-]] -import { modifier, type NamedArgs, type PositionalArgs } from "ember-modifier"; +import { modifier } from "ember-modifier"; export interface [[signature]] { Args: { @@ -54,22 +54,22 @@ export default modifier<[[signature]]>(function [[name]](element, positional, na [[name := pascal(inputs.name)-]] [[signature := (pascal(inputs.name) + "Signature")-]] -import Modifier, { type NamedArgs, type PositionalArgs } from "ember-modifier"; +import Modifier from "ember-modifier"; + +type Named = {}; +type Positional = []; +type Element = null; export interface [[signature]] { Args: { - Named: {}; - Positional: []; + Named: Named; + Positional: Positional; }; - Element: null; + Element: Element; } export default class [[name]] extends Modifier<[[signature]]> { - modify( - element: [[signature]]["Element"], - positional: PositionalArgs<[[signature]]>, - named: NamedArgs<[[signature]]>, - ) {} + modify(element: Element, positional: Positional, named: Named) {} } ``` diff --git a/test/__snapshots__/generate-modifier.test.ts.snap b/test/__snapshots__/generate-modifier.test.ts.snap index 25d517e..6f28e77 100644 --- a/test/__snapshots__/generate-modifier.test.ts.snap +++ b/test/__snapshots__/generate-modifier.test.ts.snap @@ -10,22 +10,22 @@ export default class Foo extends Modifier { `; exports[`generates a class-based \`.ts\` modifier 1`] = ` -"import Modifier, { type NamedArgs, type PositionalArgs } from "ember-modifier"; +"import Modifier from "ember-modifier"; + +type Named = {}; +type Positional = []; +type Element = null; export interface FooSignature { Args: { - Named: {}; - Positional: []; + Named: Named; + Positional: Positional; }; - Element: null; + Element: Element; } export default class Foo extends Modifier { - modify( - element: FooSignature["Element"], - positional: PositionalArgs, - named: NamedArgs, - ) {} + modify(element: Element, positional: Positional, named: Named) {} } " `; @@ -45,7 +45,7 @@ export default modifier(function foo(element, positional, named) {}); `; exports[`generates a function-based \`.ts\` modifier 1`] = ` -"import { modifier, type NamedArgs, type PositionalArgs } from "ember-modifier"; +"import { modifier } from "ember-modifier"; export interface FooSignature { Args: { @@ -60,7 +60,7 @@ export default modifier(function foo(element, positional, named) { `; exports[`generates a function-based \`.ts\` modifier at a custom path 1`] = ` -"import { modifier, type NamedArgs, type PositionalArgs } from "ember-modifier"; +"import { modifier } from "ember-modifier"; export interface FooSignature { Args: {