@astrojs/language-server 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/core/documents/DocumentMapper.d.ts +2 -1
  3. package/dist/core/documents/DocumentMapper.js +8 -1
  4. package/dist/core/documents/utils.d.ts +1 -0
  5. package/dist/core/documents/utils.js +2 -0
  6. package/dist/plugins/PluginHost.d.ts +2 -1
  7. package/dist/plugins/PluginHost.js +4 -0
  8. package/dist/plugins/astro/AstroPlugin.d.ts +1 -1
  9. package/dist/plugins/astro/AstroPlugin.js +1 -1
  10. package/dist/plugins/astro/features/CompletionsProvider.d.ts +5 -6
  11. package/dist/plugins/astro/features/CompletionsProvider.js +50 -59
  12. package/dist/plugins/css/CSSPlugin.d.ts +2 -1
  13. package/dist/plugins/css/CSSPlugin.js +27 -28
  14. package/dist/plugins/css/features/astro-selectors.js +1 -2
  15. package/dist/plugins/html/HTMLPlugin.d.ts +1 -0
  16. package/dist/plugins/html/HTMLPlugin.js +8 -3
  17. package/dist/plugins/html/features/astro-attributes.d.ts +1 -0
  18. package/dist/plugins/html/features/astro-attributes.js +67 -3
  19. package/dist/plugins/html/utils.d.ts +6 -0
  20. package/dist/plugins/html/utils.js +11 -0
  21. package/dist/plugins/typescript/TypeScriptPlugin.d.ts +3 -1
  22. package/dist/plugins/typescript/TypeScriptPlugin.js +8 -0
  23. package/dist/plugins/typescript/astro2tsx.js +5 -1
  24. package/dist/plugins/typescript/features/DiagnosticsProvider.js +44 -58
  25. package/dist/plugins/typescript/features/DocumentSymbolsProvider.js +6 -3
  26. package/dist/plugins/typescript/features/SemanticTokenProvider.d.ts +15 -0
  27. package/dist/plugins/typescript/features/SemanticTokenProvider.js +81 -0
  28. package/dist/plugins/typescript/language-service.d.ts +1 -1
  29. package/dist/plugins/typescript/language-service.js +44 -23
  30. package/dist/plugins/typescript/snapshots/SnapshotManager.js +2 -1
  31. package/dist/plugins/typescript/utils.d.ts +24 -1
  32. package/dist/plugins/typescript/utils.js +32 -1
  33. package/dist/server.js +27 -2
  34. package/dist/utils.d.ts +8 -5
  35. package/dist/utils.js +34 -16
  36. package/package.json +3 -3
  37. package/types/astro-jsx.d.ts +112 -113
package/dist/server.js CHANGED
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.startLanguageServer = void 0;
27
27
  const vscode = __importStar(require("vscode-languageserver"));
28
+ const vscode_languageserver_1 = require("vscode-languageserver");
28
29
  const ConfigManager_1 = require("./core/config/ConfigManager");
29
30
  const DocumentManager_1 = require("./core/documents/DocumentManager");
30
31
  const DiagnosticsManager_1 = require("./core/DiagnosticsManager");
@@ -32,8 +33,9 @@ const AstroPlugin_1 = require("./plugins/astro/AstroPlugin");
32
33
  const CSSPlugin_1 = require("./plugins/css/CSSPlugin");
33
34
  const HTMLPlugin_1 = require("./plugins/html/HTMLPlugin");
34
35
  const PluginHost_1 = require("./plugins/PluginHost");
35
- const TypeScriptPlugin_1 = require("./plugins/typescript/TypeScriptPlugin");
36
+ const plugins_1 = require("./plugins");
36
37
  const utils_1 = require("./utils");
38
+ const utils_2 = require("./plugins/typescript/utils");
37
39
  const TagCloseRequest = new vscode.RequestType('html/tag');
38
40
  // Start the language server
39
41
  function startLanguageServer(connection) {
@@ -44,6 +46,22 @@ function startLanguageServer(connection) {
44
46
  connection.onInitialize((params) => {
45
47
  var _a, _b, _c, _d, _e, _f;
46
48
  const workspaceUris = (_b = (_a = params.workspaceFolders) === null || _a === void 0 ? void 0 : _a.map((folder) => folder.uri.toString())) !== null && _b !== void 0 ? _b : [(_c = params.rootUri) !== null && _c !== void 0 ? _c : ''];
49
+ workspaceUris.forEach((uri) => {
50
+ uri = (0, utils_1.urlToPath)(uri);
51
+ const astroVersion = (0, utils_1.getUserAstroVersion)(uri);
52
+ if (astroVersion.exist === false) {
53
+ connection.sendNotification(vscode_languageserver_1.ShowMessageNotification.type, {
54
+ message: `Couldn't find Astro in workspace "${uri}". Experience might be degraded. For the best experience, please make sure Astro is installed and then restart the language server`,
55
+ type: vscode_languageserver_1.MessageType.Warning,
56
+ });
57
+ }
58
+ if (astroVersion.exist && astroVersion.major === 0 && astroVersion.minor < 24 && astroVersion.patch < 5) {
59
+ connection.sendNotification(vscode_languageserver_1.ShowMessageNotification.type, {
60
+ message: `The version of Astro you're using (${astroVersion.full}) is not supported by this version of the Astro language server. Please upgrade Astro to any version higher than 0.23.4 or if using the VS Code extension, downgrade the extension to 0.8.10`,
61
+ type: vscode_languageserver_1.MessageType.Error,
62
+ });
63
+ }
64
+ });
47
65
  pluginHost.initialize({
48
66
  filterIncompleteCompletions: !((_d = params.initializationOptions) === null || _d === void 0 ? void 0 : _d.dontFilterIncompleteCompletions),
49
67
  definitionLinkSupport: !!((_f = (_e = params.capabilities.textDocument) === null || _e === void 0 ? void 0 : _e.definition) === null || _f === void 0 ? void 0 : _f.linkSupport),
@@ -54,7 +72,7 @@ function startLanguageServer(connection) {
54
72
  // We don't currently support running the TypeScript and Astro plugin in the browser
55
73
  if (params.initializationOptions.environment !== 'browser') {
56
74
  pluginHost.registerPlugin(new AstroPlugin_1.AstroPlugin(documentManager, configManager, workspaceUris));
57
- pluginHost.registerPlugin(new TypeScriptPlugin_1.TypeScriptPlugin(documentManager, configManager, workspaceUris));
75
+ pluginHost.registerPlugin(new plugins_1.TypeScriptPlugin(documentManager, configManager, workspaceUris));
58
76
  }
59
77
  // Update language-server config with what the user supplied to us at launch
60
78
  configManager.updateConfig(params.initializationOptions.configuration.astro);
@@ -97,6 +115,11 @@ function startLanguageServer(connection) {
97
115
  colorProvider: true,
98
116
  hoverProvider: true,
99
117
  documentSymbolProvider: true,
118
+ semanticTokensProvider: {
119
+ legend: (0, utils_2.getSemanticTokenLegend)(),
120
+ range: true,
121
+ full: true,
122
+ },
100
123
  signatureHelpProvider: {
101
124
  triggerCharacters: ['(', ',', '<'],
102
125
  retriggerCharacters: [')'],
@@ -146,6 +169,8 @@ function startLanguageServer(connection) {
146
169
  return pluginHost.resolveCompletion(data, completionItem);
147
170
  });
148
171
  connection.onDocumentSymbol((params, cancellationToken) => pluginHost.getDocumentSymbols(params.textDocument, cancellationToken));
172
+ connection.onRequest(vscode_languageserver_1.SemanticTokensRequest.type, (evt, cancellationToken) => pluginHost.getSemanticTokens(evt.textDocument, undefined, cancellationToken));
173
+ connection.onRequest(vscode_languageserver_1.SemanticTokensRangeRequest.type, (evt, cancellationToken) => pluginHost.getSemanticTokens(evt.textDocument, evt.range, cancellationToken));
149
174
  connection.onDocumentColor((params) => pluginHost.getDocumentColors(params.textDocument));
150
175
  connection.onColorPresentation((params) => pluginHost.getColorPresentations(params.textDocument, params.range, params.color));
151
176
  connection.onRequest(TagCloseRequest, (evt) => pluginHost.doTagComplete(evt.textDocument, evt.position));
package/dist/utils.d.ts CHANGED
@@ -21,11 +21,6 @@ export declare function getLastPartOfPath(path: string): string;
21
21
  * This is not a 100% sure test as it'll return false for any component that does not match the standard format for a component
22
22
  */
23
23
  export declare function isPossibleComponent(node: Node): boolean;
24
- /**
25
- * Return true if a specific node could be a component with a client directive on it.
26
- * This is not a 100% sure test as it'll return false for any component that does not match the standard format for a component
27
- */
28
- export declare function isPossibleClientComponent(node: Node): boolean;
29
24
  /** Flattens an array */
30
25
  export declare function flatten<T>(arr: T[][]): T[];
31
26
  /** Clamps a number between min and max */
@@ -51,3 +46,11 @@ export declare function debounceSameArg<T>(fn: (arg: T) => void, shouldCancelPre
51
46
  * @param milliseconds Number of milliseconds to debounce/throttle
52
47
  */
53
48
  export declare function debounceThrottle<T extends (...args: any) => void>(fn: T, milliseconds: number): T;
49
+ export interface AstroVersion {
50
+ full: string;
51
+ major: number;
52
+ minor: number;
53
+ patch: number;
54
+ exist: boolean;
55
+ }
56
+ export declare function getUserAstroVersion(basePath: string): AstroVersion;
package/dist/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debounceThrottle = exports.debounceSameArg = exports.isBeforeOrEqualToPosition = exports.isInRange = exports.isNotNullOrUndefined = exports.clamp = exports.flatten = exports.isPossibleClientComponent = exports.isPossibleComponent = exports.getLastPartOfPath = exports.pathToUrl = exports.urlToPath = exports.normalizePath = exports.normalizeUri = void 0;
3
+ exports.getUserAstroVersion = exports.debounceThrottle = exports.debounceSameArg = exports.isBeforeOrEqualToPosition = exports.isInRange = exports.isNotNullOrUndefined = exports.clamp = exports.flatten = exports.isPossibleComponent = exports.getLastPartOfPath = exports.pathToUrl = exports.urlToPath = exports.normalizePath = exports.normalizeUri = void 0;
4
4
  const vscode_uri_1 = require("vscode-uri");
5
5
  /** Normalizes a document URI */
6
6
  function normalizeUri(uri) {
@@ -46,21 +46,6 @@ function isPossibleComponent(node) {
46
46
  return !!((_a = node.tag) === null || _a === void 0 ? void 0 : _a[0].match(/[A-Z]/)) || !!((_b = node.tag) === null || _b === void 0 ? void 0 : _b.match(/.+[.][A-Z]/));
47
47
  }
48
48
  exports.isPossibleComponent = isPossibleComponent;
49
- /**
50
- * Return true if a specific node could be a component with a client directive on it.
51
- * This is not a 100% sure test as it'll return false for any component that does not match the standard format for a component
52
- */
53
- function isPossibleClientComponent(node) {
54
- if (isPossibleComponent(node) && node.attributes) {
55
- for (let [name] of Object.entries(node.attributes)) {
56
- if (name.startsWith('client:')) {
57
- return true;
58
- }
59
- }
60
- }
61
- return false;
62
- }
63
- exports.isPossibleClientComponent = isPossibleClientComponent;
64
49
  /** Flattens an array */
65
50
  function flatten(arr) {
66
51
  return arr.reduce((all, item) => [...all, ...item], []);
@@ -132,3 +117,36 @@ function debounceThrottle(fn, milliseconds) {
132
117
  return maybeCall;
133
118
  }
134
119
  exports.debounceThrottle = debounceThrottle;
120
+ function getUserAstroVersion(basePath) {
121
+ let version = '0.0.0';
122
+ let exist = true;
123
+ try {
124
+ const astroPackageJson = require.resolve('astro/package.json', { paths: [basePath] });
125
+ version = require(astroPackageJson).version;
126
+ }
127
+ catch {
128
+ // If we couldn't find it inside the workspace's node_modules, it might means we're in the monorepo
129
+ try {
130
+ const monorepoPackageJson = require.resolve('./packages/astro/package.json', { paths: [basePath] });
131
+ version = require(monorepoPackageJson).version;
132
+ }
133
+ catch (e) {
134
+ // If we still couldn't find it, it probably just doesn't exist
135
+ exist = false;
136
+ console.error(e);
137
+ }
138
+ }
139
+ let [major, minor, patch] = version.split('.');
140
+ if (patch.includes('-')) {
141
+ const patchParts = patch.split('-');
142
+ patch = patchParts[0];
143
+ }
144
+ return {
145
+ full: version,
146
+ major: Number(major),
147
+ minor: Number(minor),
148
+ patch: Number(patch),
149
+ exist,
150
+ };
151
+ }
152
+ exports.getUserAstroVersion = getUserAstroVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/language-server",
3
- "version": "0.13.2",
3
+ "version": "0.14.0",
4
4
  "author": "withastro",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "tsc",
18
18
  "dev": "astro-scripts dev \"src/**/*.ts\"",
19
- "test": "cross-env TS_NODE_TRANSPILE_ONLY=true mocha --require ts-node/register \"test/**/*.ts\" --exclude \"test/**/*.d.ts\""
19
+ "test": "cross-env TS_NODE_TRANSPILE_ONLY=true mocha --timeout 20000 --require ts-node/register \"test/**/*.ts\" --exclude \"test/**/*.d.ts\""
20
20
  },
21
21
  "dependencies": {
22
22
  "@astrojs/svelte-language-integration": "^0.1.2",
@@ -37,7 +37,7 @@
37
37
  "@types/lodash": "^4.14.179",
38
38
  "@types/mocha": "^9.1.0",
39
39
  "@types/sinon": "^10.0.11",
40
- "astro": "^0.23.7",
40
+ "astro": "^1.0.0-beta.1",
41
41
  "astro-scripts": "0.0.1",
42
42
  "chai": "^4.3.6",
43
43
  "cross-env": "^7.0.3",
@@ -43,6 +43,19 @@ declare namespace astroHTML.JSX {
43
43
  'define:vars'?: any;
44
44
  }
45
45
 
46
+ // Usable exclusively on style tags
47
+ interface AstroStyle {
48
+ global?: boolean;
49
+ 'is:global'?: boolean;
50
+ 'is:inline'?: boolean;
51
+ }
52
+
53
+ // Usable exclusively on script tags
54
+ interface AstroScript {
55
+ hoist?: boolean;
56
+ 'is:inline'?: boolean;
57
+ }
58
+
46
59
  type Element = HTMLElement;
47
60
 
48
61
  //
@@ -68,155 +81,141 @@ declare namespace astroHTML.JSX {
68
81
  type TransitionEventHandler<T extends EventTarget> = EventHandler<TransitionEvent, T>;
69
82
  type MessageEventHandler<T extends EventTarget> = EventHandler<MessageEvent, T>;
70
83
 
71
- // See CSS 3 CSS-wide keywords https://www.w3.org/TR/css3-values/#common-keywords
72
- // See CSS 3 Explicit Defaulting https://www.w3.org/TR/css-cascade-3/#defaulting-keywords
73
- // "all CSS properties can accept these values"
74
- type CSSWideKeyword = 'initial' | 'inherit' | 'unset';
75
-
76
- // See CSS 3 <percentage> type https://drafts.csswg.org/css-values-3/#percentages
77
- type CSSPercentage = string;
78
-
79
- // See CSS 3 <length> type https://drafts.csswg.org/css-values-3/#lengths
80
- type CSSLength = number | string;
81
-
82
- // This interface is not complete. Only properties accepting
83
- // unit-less numbers are listed here (see CSSProperty.js in React)
84
-
85
84
  interface DOMAttributes<T extends EventTarget> {
86
85
  children?: Children;
87
86
 
88
87
  // Clipboard Events
89
- oncopy?: ClipboardEventHandler<T> | undefined | null;
90
- oncut?: ClipboardEventHandler<T> | undefined | null;
91
- onpaste?: ClipboardEventHandler<T> | undefined | null;
88
+ oncopy?: ClipboardEventHandler<T> | string | undefined | null;
89
+ oncut?: ClipboardEventHandler<T> | string | undefined | null;
90
+ onpaste?: ClipboardEventHandler<T> | string | undefined | null;
92
91
 
93
92
  // Composition Events
94
- oncompositionend?: CompositionEventHandler<T> | undefined | null;
95
- oncompositionstart?: CompositionEventHandler<T> | undefined | null;
96
- oncompositionupdate?: CompositionEventHandler<T> | undefined | null;
93
+ oncompositionend?: CompositionEventHandler<T> | string | undefined | null;
94
+ oncompositionstart?: CompositionEventHandler<T> | string | undefined | null;
95
+ oncompositionupdate?: CompositionEventHandler<T> | string | undefined | null;
97
96
 
98
97
  // Focus Events
99
- onfocus?: FocusEventHandler<T> | undefined | null;
100
- onfocusin?: FocusEventHandler<T> | undefined | null;
101
- onfocusout?: FocusEventHandler<T> | undefined | null;
102
- onblur?: FocusEventHandler<T> | undefined | null;
98
+ onfocus?: FocusEventHandler<T> | string | undefined | null;
99
+ onfocusin?: FocusEventHandler<T> | string | undefined | null;
100
+ onfocusout?: FocusEventHandler<T> | string | undefined | null;
101
+ onblur?: FocusEventHandler<T> | string | undefined | null;
103
102
 
104
103
  // Form Events
105
- onchange?: FormEventHandler<T> | undefined | null;
106
- oninput?: FormEventHandler<T> | undefined | null;
107
- onreset?: FormEventHandler<T> | undefined | null;
108
- onsubmit?: EventHandler<SubmitEvent, T> | undefined | null;
109
- oninvalid?: EventHandler<Event, T> | undefined | null;
110
- onbeforeinput?: EventHandler<InputEvent, T> | undefined | null;
104
+ onchange?: FormEventHandler<T> | string | undefined | null;
105
+ oninput?: FormEventHandler<T> | string | undefined | null;
106
+ onreset?: FormEventHandler<T> | string | undefined | null;
107
+ onsubmit?: EventHandler<SubmitEvent, T> | string | undefined | null;
108
+ oninvalid?: EventHandler<Event, T> | string | undefined | null;
109
+ onbeforeinput?: EventHandler<InputEvent, T> | string | undefined | null;
111
110
 
112
111
  // Image Events
113
- onload?: EventHandler | undefined | null;
114
- onerror?: EventHandler | undefined | null; // also a Media Event
112
+ onload?: EventHandler | string | undefined | null;
113
+ onerror?: EventHandler | string | undefined | null; // also a Media Event
115
114
 
116
115
  // Detail Events
117
- ontoggle?: EventHandler<Event, T> | undefined | null;
116
+ ontoggle?: EventHandler<Event, T> | string | undefined | null;
118
117
 
119
118
  // Keyboard Events
120
- onkeydown?: KeyboardEventHandler<T> | undefined | null;
121
- onkeypress?: KeyboardEventHandler<T> | undefined | null;
122
- onkeyup?: KeyboardEventHandler<T> | undefined | null;
119
+ onkeydown?: KeyboardEventHandler<T> | string | undefined | null;
120
+ onkeypress?: KeyboardEventHandler<T> | string | undefined | null;
121
+ onkeyup?: KeyboardEventHandler<T> | string | undefined | null;
123
122
 
124
123
  // Media Events
125
- onabort?: EventHandler<Event, T> | undefined | null;
126
- oncanplay?: EventHandler<Event, T> | undefined | null;
127
- oncanplaythrough?: EventHandler<Event, T> | undefined | null;
128
- oncuechange?: EventHandler<Event, T> | undefined | null;
129
- ondurationchange?: EventHandler<Event, T> | undefined | null;
130
- onemptied?: EventHandler<Event, T> | undefined | null;
131
- onencrypted?: EventHandler<Event, T> | undefined | null;
132
- onended?: EventHandler<Event, T> | undefined | null;
133
- onloadeddata?: EventHandler<Event, T> | undefined | null;
134
- onloadedmetadata?: EventHandler<Event, T> | undefined | null;
135
- onloadstart?: EventHandler<Event, T> | undefined | null;
136
- onpause?: EventHandler<Event, T> | undefined | null;
137
- onplay?: EventHandler<Event, T> | undefined | null;
138
- onplaying?: EventHandler<Event, T> | undefined | null;
139
- onprogress?: EventHandler<Event, T> | undefined | null;
140
- onratechange?: EventHandler<Event, T> | undefined | null;
141
- onseeked?: EventHandler<Event, T> | undefined | null;
142
- onseeking?: EventHandler<Event, T> | undefined | null;
143
- onstalled?: EventHandler<Event, T> | undefined | null;
144
- onsuspend?: EventHandler<Event, T> | undefined | null;
145
- ontimeupdate?: EventHandler<Event, T> | undefined | null;
146
- onvolumechange?: EventHandler<Event, T> | undefined | null;
147
- onwaiting?: EventHandler<Event, T> | undefined | null;
124
+ onabort?: EventHandler<Event, T> | string | undefined | null;
125
+ oncanplay?: EventHandler<Event, T> | string | undefined | null;
126
+ oncanplaythrough?: EventHandler<Event, T> | string | undefined | null;
127
+ oncuechange?: EventHandler<Event, T> | string | undefined | null;
128
+ ondurationchange?: EventHandler<Event, T> | string | undefined | null;
129
+ onemptied?: EventHandler<Event, T> | string | undefined | null;
130
+ onencrypted?: EventHandler<Event, T> | string | undefined | null;
131
+ onended?: EventHandler<Event, T> | string | undefined | null;
132
+ onloadeddata?: EventHandler<Event, T> | string | undefined | null;
133
+ onloadedmetadata?: EventHandler<Event, T> | string | undefined | null;
134
+ onloadstart?: EventHandler<Event, T> | string | undefined | null;
135
+ onpause?: EventHandler<Event, T> | string | undefined | null;
136
+ onplay?: EventHandler<Event, T> | string | undefined | null;
137
+ onplaying?: EventHandler<Event, T> | string | undefined | null;
138
+ onprogress?: EventHandler<Event, T> | string | undefined | null;
139
+ onratechange?: EventHandler<Event, T> | string | undefined | null;
140
+ onseeked?: EventHandler<Event, T> | string | undefined | null;
141
+ onseeking?: EventHandler<Event, T> | string | undefined | null;
142
+ onstalled?: EventHandler<Event, T> | string | undefined | null;
143
+ onsuspend?: EventHandler<Event, T> | string | undefined | null;
144
+ ontimeupdate?: EventHandler<Event, T> | string | undefined | null;
145
+ onvolumechange?: EventHandler<Event, T> | string | undefined | null;
146
+ onwaiting?: EventHandler<Event, T> | string | undefined | null;
148
147
 
149
148
  // MouseEvents
150
- onauxclick?: MouseEventHandler<T> | undefined | null;
151
- onclick?: MouseEventHandler<T> | undefined | null;
152
- oncontextmenu?: MouseEventHandler<T> | undefined | null;
153
- ondblclick?: MouseEventHandler<T> | undefined | null;
154
- ondrag?: DragEventHandler<T> | undefined | null;
155
- ondragend?: DragEventHandler<T> | undefined | null;
156
- ondragenter?: DragEventHandler<T> | undefined | null;
157
- ondragexit?: DragEventHandler<T> | undefined | null;
158
- ondragleave?: DragEventHandler<T> | undefined | null;
159
- ondragover?: DragEventHandler<T> | undefined | null;
160
- ondragstart?: DragEventHandler<T> | undefined | null;
161
- ondrop?: DragEventHandler<T> | undefined | null;
162
- onmousedown?: MouseEventHandler<T> | undefined | null;
163
- onmouseenter?: MouseEventHandler<T> | undefined | null;
164
- onmouseleave?: MouseEventHandler<T> | undefined | null;
165
- onmousemove?: MouseEventHandler<T> | undefined | null;
166
- onmouseout?: MouseEventHandler<T> | undefined | null;
167
- onmouseover?: MouseEventHandler<T> | undefined | null;
168
- onmouseup?: MouseEventHandler<T> | undefined | null;
149
+ onauxclick?: MouseEventHandler<T> | string | undefined | null;
150
+ onclick?: MouseEventHandler<T> | string | undefined | null;
151
+ oncontextmenu?: MouseEventHandler<T> | string | undefined | null;
152
+ ondblclick?: MouseEventHandler<T> | string | undefined | null;
153
+ ondrag?: DragEventHandler<T> | string | undefined | null;
154
+ ondragend?: DragEventHandler<T> | string | undefined | null;
155
+ ondragenter?: DragEventHandler<T> | string | undefined | null;
156
+ ondragexit?: DragEventHandler<T> | string | undefined | null;
157
+ ondragleave?: DragEventHandler<T> | string | undefined | null;
158
+ ondragover?: DragEventHandler<T> | string | undefined | null;
159
+ ondragstart?: DragEventHandler<T> | string | undefined | null;
160
+ ondrop?: DragEventHandler<T> | string | undefined | null;
161
+ onmousedown?: MouseEventHandler<T> | string | undefined | null;
162
+ onmouseenter?: MouseEventHandler<T> | string | undefined | null;
163
+ onmouseleave?: MouseEventHandler<T> | string | undefined | null;
164
+ onmousemove?: MouseEventHandler<T> | string | undefined | null;
165
+ onmouseout?: MouseEventHandler<T> | string | undefined | null;
166
+ onmouseover?: MouseEventHandler<T> | string | undefined | null;
167
+ onmouseup?: MouseEventHandler<T> | string | undefined | null;
169
168
 
170
169
  // Selection Events
171
- onselect?: EventHandler<Event, T> | undefined | null;
172
- onselectionchange?: EventHandler<Event, T> | undefined | null;
173
- onselectstart?: EventHandler<Event, T> | undefined | null;
170
+ onselect?: EventHandler<Event, T> | string | undefined | null;
171
+ onselectionchange?: EventHandler<Event, T> | string | undefined | null;
172
+ onselectstart?: EventHandler<Event, T> | string | undefined | null;
174
173
 
175
174
  // Touch Events
176
- ontouchcancel?: TouchEventHandler<T> | undefined | null;
177
- ontouchend?: TouchEventHandler<T> | undefined | null;
178
- ontouchmove?: TouchEventHandler<T> | undefined | null;
179
- ontouchstart?: TouchEventHandler<T> | undefined | null;
175
+ ontouchcancel?: TouchEventHandler<T> | string | undefined | null;
176
+ ontouchend?: TouchEventHandler<T> | string | undefined | null;
177
+ ontouchmove?: TouchEventHandler<T> | string | undefined | null;
178
+ ontouchstart?: TouchEventHandler<T> | string | undefined | null;
180
179
 
181
180
  // Pointer Events
182
- ongotpointercapture?: PointerEventHandler<T> | undefined | null;
183
- onpointercancel?: PointerEventHandler<T> | undefined | null;
184
- onpointerdown?: PointerEventHandler<T> | undefined | null;
185
- onpointerenter?: PointerEventHandler<T> | undefined | null;
186
- onpointerleave?: PointerEventHandler<T> | undefined | null;
187
- onpointermove?: PointerEventHandler<T> | undefined | null;
188
- onpointerout?: PointerEventHandler<T> | undefined | null;
189
- onpointerover?: PointerEventHandler<T> | undefined | null;
190
- onpointerup?: PointerEventHandler<T> | undefined | null;
191
- onlostpointercapture?: PointerEventHandler<T> | undefined | null;
181
+ ongotpointercapture?: PointerEventHandler<T> | string | undefined | null;
182
+ onpointercancel?: PointerEventHandler<T> | string | undefined | null;
183
+ onpointerdown?: PointerEventHandler<T> | string | undefined | null;
184
+ onpointerenter?: PointerEventHandler<T> | string | undefined | null;
185
+ onpointerleave?: PointerEventHandler<T> | string | undefined | null;
186
+ onpointermove?: PointerEventHandler<T> | string | undefined | null;
187
+ onpointerout?: PointerEventHandler<T> | string | undefined | null;
188
+ onpointerover?: PointerEventHandler<T> | string | undefined | null;
189
+ onpointerup?: PointerEventHandler<T> | string | undefined | null;
190
+ onlostpointercapture?: PointerEventHandler<T> | string | undefined | null;
192
191
 
193
192
  // UI Events
194
- onscroll?: UIEventHandler<T> | undefined | null;
195
- onresize?: UIEventHandler<T> | undefined | null;
193
+ onscroll?: UIEventHandler<T> | string | undefined | null;
194
+ onresize?: UIEventHandler<T> | string | undefined | null;
196
195
 
197
196
  // Wheel Events
198
- onwheel?: WheelEventHandler<T> | undefined | null;
197
+ onwheel?: WheelEventHandler<T> | string | undefined | null;
199
198
 
200
199
  // Animation Events
201
- onanimationstart?: AnimationEventHandler<T> | undefined | null;
202
- onanimationend?: AnimationEventHandler<T> | undefined | null;
203
- onanimationiteration?: AnimationEventHandler<T> | undefined | null;
200
+ onanimationstart?: AnimationEventHandler<T> | string | undefined | null;
201
+ onanimationend?: AnimationEventHandler<T> | string | undefined | null;
202
+ onanimationiteration?: AnimationEventHandler<T> | string | undefined | null;
204
203
 
205
204
  // Transition Events
206
- ontransitionstart?: TransitionEventHandler<T> | undefined | null;
207
- ontransitionrun?: TransitionEventHandler<T> | undefined | null;
208
- ontransitionend?: TransitionEventHandler<T> | undefined | null;
209
- ontransitioncancel?: TransitionEventHandler<T> | undefined | null;
205
+ ontransitionstart?: TransitionEventHandler<T> | string | undefined | null;
206
+ ontransitionrun?: TransitionEventHandler<T> | string | undefined | null;
207
+ ontransitionend?: TransitionEventHandler<T> | string | undefined | null;
208
+ ontransitioncancel?: TransitionEventHandler<T> | string | undefined | null;
210
209
 
211
210
  // Message Events
212
- onmessage?: MessageEventHandler<T> | undefined | null;
213
- onmessageerror?: MessageEventHandler<T> | undefined | null;
211
+ onmessage?: MessageEventHandler<T> | string | undefined | null;
212
+ onmessageerror?: MessageEventHandler<T> | string | undefined | null;
214
213
 
215
214
  // Global Events
216
- oncancel?: EventHandler<Event, T> | undefined | null;
217
- onclose?: EventHandler<Event, T> | undefined | null;
218
- onfullscreenchange?: EventHandler<Event, T> | undefined | null;
219
- onfullscreenerror?: EventHandler<Event, T> | undefined | null;
215
+ oncancel?: EventHandler<Event, T> | string | undefined | null;
216
+ onclose?: EventHandler<Event, T> | string | undefined | null;
217
+ onfullscreenchange?: EventHandler<Event, T> | string | undefined | null;
218
+ onfullscreenerror?: EventHandler<Event, T> | string | undefined | null;
220
219
  }
221
220
 
222
221
  // All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
@@ -988,14 +987,14 @@ declare namespace astroHTML.JSX {
988
987
  ruby: HTMLProps<HTMLElement>;
989
988
  s: HTMLProps<HTMLElement>;
990
989
  samp: HTMLProps<HTMLElement>;
991
- script: HTMLProps<HTMLElement> & AstroDefineVars;
990
+ script: HTMLProps<HTMLElement> & AstroDefineVars & AstroScript;
992
991
  section: HTMLProps<HTMLElement>;
993
992
  select: HTMLProps<HTMLSelectElement>;
994
993
  small: HTMLProps<HTMLElement>;
995
994
  source: HTMLProps<HTMLSourceElement>;
996
995
  span: HTMLProps<HTMLSpanElement>;
997
996
  strong: HTMLProps<HTMLElement>;
998
- style: HTMLProps<HTMLStyleElement> & AstroDefineVars;
997
+ style: HTMLProps<HTMLStyleElement> & AstroDefineVars & AstroStyle;
999
998
  sub: HTMLProps<HTMLElement>;
1000
999
  summary: HTMLProps<HTMLElement>;
1001
1000
  sup: HTMLProps<HTMLElement>;