diff --git a/.changeset/blue-buses-train.md b/.changeset/blue-buses-train.md new file mode 100644 index 0000000000..52ea34e6a3 --- /dev/null +++ b/.changeset/blue-buses-train.md @@ -0,0 +1,5 @@ +--- +"@marko/runtime-tags": patch +--- + +Fix exported types. diff --git a/packages/runtime-tags/index.d.ts b/packages/runtime-tags/index.d.ts index b936ab3f93..04e4ad80cb 100644 --- a/packages/runtime-tags/index.d.ts +++ b/packages/runtime-tags/index.d.ts @@ -85,7 +85,7 @@ declare global { reference: ParentNode & Node, position?: "afterbegin" | "afterend" | "beforebegin" | "beforeend", ): { - update(input: Input): void; + update(input: Marko.TemplateInput): void; destroy(): void; }; /** @marko-overload-end */ diff --git a/packages/runtime-tags/package.json b/packages/runtime-tags/package.json index af20df70ea..069817e708 100644 --- a/packages/runtime-tags/package.json +++ b/packages/runtime-tags/package.json @@ -17,14 +17,20 @@ }, "license": "MIT", "exports": { - "./*.d.marko": "./tag-types/*", + ".": { + "types": "./index.d.ts" + }, "./translator": "./src/translator/index.ts", - "./*": "./src/*.ts", - "./debug/*": "./src/*.ts" + "./tag-types/*": "./tag-types/*", + "./debug/*": "./src/*.ts", + "./*": "./src/*.ts" }, + "types": "index.d.ts", "files": [ "dist", "tag-types", + "index.d.ts", + "tags-html.d.ts", "!**/meta.*.json", "!**/__tests__", "!**/*.tsbuildinfo" @@ -38,18 +44,21 @@ "magic-string": "^0.30.17" }, "exports:override": { - "./*.d.marko": "./tag-types/*", + ".": { + "types": "./index.d.ts" + }, "./package.json": "./package.json", "./translator": "./dist/translator/index.js", - "./*": { - "types": "./dist/*.d.ts", - "import": "./dist/*.mjs", - "default": "./dist/*.js" - }, + "./tag-types/*": "./tag-types/*", "./debug/*": { "types": "./dist/*.d.ts", "import": "./dist/debug/*.mjs", "default": "./dist/debug/*.js" + }, + "./*": { + "types": "./dist/*.d.ts", + "import": "./dist/*.mjs", + "default": "./dist/*.js" } } } diff --git a/packages/runtime-tags/tags-html.d.ts b/packages/runtime-tags/tags-html.d.ts index bf4dc6bd9b..90a824429b 100644 --- a/packages/runtime-tags/tags-html.d.ts +++ b/packages/runtime-tags/tags-html.d.ts @@ -1293,6 +1293,41 @@ declare global { * @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-width */ width?: AttrStringOrNumber; + + // NON STANDARD + + /** + * Called whenever a the `checked` property of an `input` has changed. + * When `checkedChange` is a function, `checked` becomes controlled. + * This means the `checked` property is synchronized instead of the `checked` attribute. + */ + checkedChange?: AttrMissing | ((checked: boolean) => void); + + /** + * Used to synchronize the `checked` attribute with a `value` attribute used across related `input type="checkbox"` and `input type="radio"` controls. + * When `checkedValue` is a string, the `checked` attribute will be set to a boolean that is `true` if the `checkedValue` is the same as the `value`. + * When `checkedValue` is an array of strings, the `checked` attribute will be set to a boolean that is `true` if the `checkedValue` array includes the `value`. + * If the `checkedValue` is falsy then `checked` is always `false`. + */ + checkedValue?: AttrMissing | string | string[]; + /** + * Called whenever a `input type="checkbox"` or `input type="radio"` using the `checkedValue` attribute has changed. + * When `checkedValueChange` is a function, `checked` becomes controlled. + * This means the `checked` property is synchronized instead of the `checked` attribute. + */ + checkedValueChange?: + | AttrMissing + | (( + /** Note this is hack that allows you to work with the value as both a string and a string[] without needing generics */ + checkedValue: string & string[], + ) => void); + + /** + * Called whenever a the `value` property of an `input` has changed. + * When `valueChange` is a function, `value` becomes controlled. This means + * This means the `value` property is synchronized instead of the `value` attribute. + */ + valueChange?: AttrMissing | ((value: string) => void); } interface Ins extends HTMLAttributes { @@ -1470,41 +1505,6 @@ declare global { /** @deprecated */ rev?: AttrString; - - // NON STANDARD - - /** - * Called whenever a the `checked` property of an `input` has changed. - * When `checkedChange` is a function, `checked` becomes controlled. - * This means the `checked` property is synchronized instead of the `checked` attribute. - */ - checkedChange?: AttrMissing | ((checked: boolean) => void); - - /** - * Used to synchronize the `checked` attribute with a `value` attribute used across related `input type="checkbox"` and `input type="radio"` controls. - * When `checkedValue` is a string, the `checked` attribute will be set to a boolean that is `true` if the `checkedValue` is the same as the `value`. - * When `checkedValue` is an array of strings, the `checked` attribute will be set to a boolean that is `true` if the `checkedValue` array includes the `value`. - * If the `checkedValue` is falsy then `checked` is always `false`. - */ - checkedValue?: AttrMissing | string | string[]; - /** - * Called whenever a `input type="checkbox"` or `input type="radio"` using the `checkedValue` attribute has changed. - * When `checkedValueChange` is a function, `checked` becomes controlled. - * This means the `checked` property is synchronized instead of the `checked` attribute. - */ - checkedValueChange?: - | AttrMissing - | (( - /** Note this is hack that allows you to work with the value as both a string and a string[] without needing generics */ - checkedValue: string & string[], - ) => void); - - /** - * Called whenever a the `value` property of an `input` has changed. - * When `valueChange` is a function, `value` becomes controlled. This means - * This means the `value` property is synchronized instead of the `value` attribute. - */ - valueChange?: AttrMissing | ((value: string) => void); } interface Main extends HTMLAttributes {}