Skip to content

Commit

Permalink
chore: fix tags api types
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Dec 16, 2024
1 parent 4c7089a commit 6078d47
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 45 deletions.
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

0 comments on commit 6078d47

Please sign in to comment.