Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix tags api types #2432

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blue-buses-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marko/runtime-tags": patch
---

Fix exported types.
2 changes: 1 addition & 1 deletion packages/runtime-tags/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ declare global {
reference: ParentNode & Node,
position?: "afterbegin" | "afterend" | "beforebegin" | "beforeend",
): {
update(input: Input): void;
update(input: Marko.TemplateInput<Input>): void;
destroy(): void;
};
/** @marko-overload-end */
Expand Down
27 changes: 18 additions & 9 deletions packages/runtime-tags/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
}
}
}
70 changes: 35 additions & 35 deletions packages/runtime-tags/tags-html.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLModElement> {
Expand Down Expand Up @@ -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<HTMLElement> {}
Expand Down
Loading