From 8a984b35db4836632baf63c11047a925ccf8e352 Mon Sep 17 00:00:00 2001 From: Adam Bradley Date: Sun, 25 Jul 2021 12:47:00 -0500 Subject: [PATCH] refactor: generate jsx types from types/react --- integration/todo/ui/Header_template.tsx | 2 +- package.json | 3 +- scripts/build.ts | 5 + scripts/generate/tsx/types.html | 239 --- scripts/jsx-types.ts | 332 ++++ scripts/jsx-types.unit.ts | 70 + scripts/util.ts | 1 + src/core/api.md | 1336 ++--------------- src/core/render/jsx/attributes.ts | 4 +- src/core/render/jsx/factory.ts | 8 +- src/core/render/jsx/host.ts | 5 +- src/core/render/jsx/index.ts | 4 +- src/core/render/jsx/jsx-runtime.ts | 15 +- src/core/render/jsx/types/index.ts | 5 +- src/core/render/jsx/types/jsx-generated.ts | 1217 +++++++++++++++ .../jsx/types/{jsx_node.ts => jsx-node.ts} | 0 ...x_dom_events.ts => jsx-qwik-attributes.ts} | 42 +- .../render/jsx/types/jsx-qwik-elements.ts | 19 + src/core/render/jsx/types/jsx-qwik.ts | 16 + src/core/render/jsx/types/jsx.ts | 622 -------- src/core/render/jsx/types/jsx_base.ts | 41 - src/jsx_runtime.ts | 2 +- 22 files changed, 1817 insertions(+), 2171 deletions(-) delete mode 100644 scripts/generate/tsx/types.html create mode 100644 scripts/jsx-types.ts create mode 100644 scripts/jsx-types.unit.ts create mode 100644 src/core/render/jsx/types/jsx-generated.ts rename src/core/render/jsx/types/{jsx_node.ts => jsx-node.ts} (100%) rename src/core/render/jsx/types/{jsx_dom_events.ts => jsx-qwik-attributes.ts} (74%) create mode 100644 src/core/render/jsx/types/jsx-qwik-elements.ts create mode 100644 src/core/render/jsx/types/jsx-qwik.ts delete mode 100644 src/core/render/jsx/types/jsx.ts delete mode 100644 src/core/render/jsx/types/jsx_base.ts diff --git a/integration/todo/ui/Header_template.tsx b/integration/todo/ui/Header_template.tsx index 1983ca0b6d4..3be76868534 100644 --- a/integration/todo/ui/Header_template.tsx +++ b/integration/todo/ui/Header_template.tsx @@ -18,7 +18,7 @@ export default injectMethod( diff --git a/package.json b/package.json index eb38fdbda09..c9e48eb9251 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "integration.server": "node scripts --dev && node integration/devserver.js --port 8080 --mode development", "integration.server.prod": "tsc && node scripts && node integration/devserver.js --port 8081 --mode production", "validate.build": "node -r esbuild-register scripts/validate-build.ts", + "jsx.types": "node scripts --jsx", "prepare": "husky install", "lint": "eslint \"**/*.ts*\" && npm run prettier-check", "prettier-check": "prettier --check .", @@ -143,7 +144,7 @@ "/node_modules/", "/tsc-out/" ], - "testRegex": "/src/.*\\.unit\\.(ts|tsx)$" + "testRegex": "/(scripts|src)/.*\\.unit\\.(ts|tsx)$" }, "lint-staged": { "*.*": [ diff --git a/scripts/build.ts b/scripts/build.ts index 122fad8a6c7..1f7447ae881 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -2,6 +2,7 @@ import type { BuildConfig } from './util'; import { buildDevServer } from './devserver'; import { copyFiles } from './copy-files'; import { emptyDir } from './util'; +import { generateJsxTypes } from './jsx-types'; import { generatePackageJson } from './package-json'; import { submoduleCore } from './submodule-core'; import { submoduleJsxRuntime } from './submodule-jsx-runtime'; @@ -39,6 +40,10 @@ export async function build(config: BuildConfig) { buildDevServer(config), ]); + if (config.jsx) { + await generateJsxTypes(config); + } + await submoduleOptimizer(config); } catch (e) { console.error(e); diff --git a/scripts/generate/tsx/types.html b/scripts/generate/tsx/types.html deleted file mode 100644 index e2c918db3a2..00000000000 --- a/scripts/generate/tsx/types.html +++ /dev/null @@ -1,239 +0,0 @@ - - -
-/**
-* @license
-* Copyright Builder.io, Inc. All Rights Reserved.
-*
-* Use of this source code is governed by an MIT-style license that can be
-* found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE
-*/
-
-///////////////////////////////////////////////////
-///////////////////////////////////////////////////
-////   -- DO NOT EDIT  --  GENERATED FILE  --  ////
-//// See: `generate/tsx/types.html`            ////
-///////////////////////////////////////////////////
-///////////////////////////////////////////////////
-
-import type { QRL } from '../../import/qrl.js';
-import type { JSXBase } from './html_base.js';
-
-declare global {
-  namespace JSX {
-    interface IntrinsicElements {
-

-    
-  }
-}
-
-/**
- * @internal
- */
-// So that this file is treated as module.
-export type JSX_IntrinsicElements = JSX.IntrinsicElements;
-
-
- - - diff --git a/scripts/jsx-types.ts b/scripts/jsx-types.ts new file mode 100644 index 00000000000..f701f41287a --- /dev/null +++ b/scripts/jsx-types.ts @@ -0,0 +1,332 @@ +import type { BuildConfig } from './util'; +import { createWriteStream, readFileSync, writeFileSync } from 'fs'; +import { get } from 'https'; +import { format, resolveConfig } from 'prettier'; +import { join } from 'path'; +import ts from 'typescript'; + +/** + * Generate non-global JSX types so it can be scoped to just @builder.io/qwik. + * Download the latest `@types/react` `index.d.ts` types file and + * generate JSX types that can be extended by Qwik types. + * Source: https://unpkg.com/@types/react/index.d.ts + */ +export async function generateJsxTypes(config: BuildConfig) { + const typesUrl = `https://unpkg.com/@types/react/index.d.ts`; + const reactTypesPath = join(config.distDir, 'react.jsx.d.ts'); + + const url = await download(typesUrl, reactTypesPath); + + const reactTypesContent = readFileSync(reactTypesPath, 'utf-8'); + const sourceFile = parse(reactTypesContent); + + // parse out all of the IntrinsicElements + const elements = getIntrinsicElements(sourceFile); + let content = generateContent(sourceFile, elements, url); + + const generatedTypesPath = join( + config.srcDir, + 'core', + 'render', + 'jsx', + 'types', + 'jsx-generated.ts' + ); + + // run prettier on the generated file so we have a consistent format + const prettierOpts = await resolveConfig(generatedTypesPath); + content = format(content, { ...prettierOpts, parser: 'typescript' }); + + writeFileSync(generatedTypesPath, content); + console.log('🐝', 'generated:', generatedTypesPath); +} + +/** + * Find and pick out the `IntrinsicElements` interface, which will + * be within React's `declare global { namespace JSX { ... } }` block. + */ +export function getIntrinsicElements(sourceFile: ts.SourceFile) { + const elements: IntrinsicElement[] = []; + const intrinsicElementsNode = getInterface(sourceFile, 'IntrinsicElements'); + + intrinsicElementsNode?.members.forEach((member) => { + if (ts.isPropertySignature(member)) { + const propSignature = member; + if (ts.isIdentifier(propSignature.name)) { + const nameIdentifier = String(propSignature.name.text); + elements.push( + generateIntrinsicElement(nameIdentifier, propSignature.type as ts.TypeReferenceNode) + ); + } + } + }); + + return elements; +} + +/** + * Parse out the tag name, attribute and element interfaces from React's `IntrinsicElements`. + * HTML and SVG elements have two different property signatures. + * + * ``` + * declare global { + * namespace JSX { + * interface IntrinsicElements { + * a: React.DetailedHTMLProps, HTMLAnchorElement>; + * svg: React.SVGProps; + * } + * } + * } + * ``` + */ +function generateIntrinsicElement(tag: string, type: ts.TypeReferenceNode) { + const typeArguments = type.typeArguments!; + const typeReference = typeArguments[0] as ts.TypeReferenceNode; + const typeName = typeReference.typeName as ts.QualifiedName; + const right = typeName.right as ts.Identifier; + + if (typeReference.typeArguments) { + const childTypeReference = typeReference.typeArguments[0] as ts.TypeReferenceNode; + const childTypeName = childTypeReference.typeName as ts.Identifier; + const element: IntrinsicElement = { + tag, + attributesInterface: right.escapedText!, + elementInterface: childTypeName.escapedText!, + }; + return element; + } else { + const typeName = type.typeName as ts.QualifiedName; + const elementTypeName = typeReference.typeName as ts.Identifier; + const element: IntrinsicElement = { + tag, + attributesInterface: typeName.right.escapedText!, + elementInterface: elementTypeName.escapedText!, + }; + + return element; + } +} + +/** + * Using the parsed out data, generate a new JSX types WITHOUT declaring a global JSX. + */ +function generateContent(sourceFile: ts.SourceFile, elements: IntrinsicElement[], url: string) { + const c = [ + `/* eslint-disable */`, + `/* DO NOT EDIT!! Auto Generated from @types/react */`, + `/* Source: ${url} */`, + `/* See DEVELOPER.md on how to update */`, + ``, + ]; + + REASSIGN.forEach((r) => c.push(r)); + + const added = new Set(); + function addType(typeName: string) { + const t = getInterfaceOrType(sourceFile, typeName); + if (t && !added.has(t.name)) { + t.usingTypes.forEach((usingTypeName) => { + addType(usingTypeName); + }); + added.add(t.name); + c.push(t.text); + } + } + elements.forEach((elm) => addType(elm.attributesInterface)); + + c.push(`export interface IntrinsicElements {`); + c.push(...elements.map((e) => `${e.tag}: ${e.attributesInterface}<${e.elementInterface}>;`)); + c.push(`}`); + + return cleanup(c.join('\n')); +} + +function cleanup(content: string) { + // api-extractor requires that @deprecated has a message, so lets fake it + content = content.replace(/\/\*\* @deprecated \*\//g, `/** @deprecated Deprecated */`); + + // manually comment out some lines we know shouldn't be included + COMMENT_OUT.forEach((commentOut) => { + const rg = new RegExp(commentOut, 'g'); + content = content.replace(rg, '// ' + commentOut); + }); + + return removeLineComments(content); +} + +/** + * Completely remove single-line comments from the text + */ +function removeLineComments(t: string) { + return t + .split('\n') + .map((l) => { + if (l.trim().startsWith('//')) { + return ''; + } + return l; + }) + .join('\n'); +} + +export function getInterfaceOrType(sourceFile: ts.SourceFile, typeName: string) { + if (!REASSIGN.has(typeName)) { + const n = getInterface(sourceFile, typeName) || getType(sourceFile, typeName); + if (n) { + const t: TypeNode = { + name: typeName, + text: ts.createPrinter().printNode(ts.EmitHint.Unspecified, n, sourceFile), + usingTypes: ts.isInterfaceDeclaration(n) ? getUsedTypes(n) : [], + }; + t.text = removeLineComments(t.text); + t.text = t.text.replace('export ', ''); + t.text = 'export ' + t.text; + return t; + } + } + return null; +} + +/** + * Pick out interfaces/types that are also used by an interface. + */ +function getUsedTypes(node: ts.InterfaceDeclaration) { + const usedTypes = new Set(); + + function collectType(type: ts.Node) { + if (type && ts.isTypeReferenceNode(type) && ts.isIdentifier(type.typeName)) { + if (type.typeName.escapedText) { + const typeName = String(type.typeName.escapedText); + usedTypes.add(typeName); + } + } + } + + if (node.heritageClauses) { + node.heritageClauses.forEach((heritageClause) => { + if (heritageClause.types) { + heritageClause.types.forEach((hType) => { + if (ts.isExpressionWithTypeArguments(hType)) { + const exp = hType.expression; + if (exp && ts.isIdentifier(exp)) { + const typeName = String(exp.escapedText); + usedTypes.add(typeName); + } + } + }); + } + }); + } + + if (node.members) { + node.members.forEach((member) => { + if (ts.isPropertySignature(member)) { + const propSignature = member; + if (propSignature.type) { + collectType(propSignature.type); + if (ts.isUnionTypeNode(propSignature.type)) { + const types = propSignature.type.types; + types.forEach(collectType); + } + } + } + }); + } + + return Array.from(usedTypes); +} + +function getInterface( + sourceFile: ts.SourceFile, + interfaceName: string +): ts.InterfaceDeclaration | undefined { + let interfaceNode: ts.InterfaceDeclaration | undefined = undefined; + function visitor(node: ts.Node) { + if (!interfaceNode) { + if (ts.isInterfaceDeclaration(node) && node.name.text === interfaceName) { + interfaceNode = node; + } else { + node.forEachChild(visitor); + } + } + } + sourceFile.forEachChild(visitor); + return interfaceNode; +} + +function getType(sourceFile: ts.SourceFile, typeName: string): ts.TypeAliasDeclaration | undefined { + let typeAliasNode: ts.TypeAliasDeclaration | undefined = undefined; + function visitor(node: ts.Node) { + if (!typeAliasNode) { + if (ts.isTypeAliasDeclaration(node) && node.name.text === typeName) { + typeAliasNode = node; + } else { + node.forEachChild(visitor); + } + } + } + sourceFile.forEachChild(visitor); + return typeAliasNode; +} + +/** + * Request and write the download to disk. + * Also follow any location redirects. + */ +function download(url: string, dest: string) { + return new Promise((resolve, reject) => { + console.log(`request: ${url}`); + get(url, (rsp) => { + if (rsp.headers.location) { + const redirectedUrl = new URL(rsp.headers.location, url).href; + download(redirectedUrl, dest).then(resolve, reject); + } else { + const file = createWriteStream(dest); + rsp.pipe(file); + file.on('finish', function () { + (file.close as any)(() => resolve(url)); + }); + } + }).on('error', reject); + }); +} + +export function parse(contents: string) { + return ts.createSourceFile('index.d.ts', contents, ts.ScriptTarget.Latest); +} + +/** + * Interfaces to reassign a new value. + */ +const REASSIGN = new Map([ + ['DOMAttributes', 'import type { DOMAttributes } from "./jsx-qwik-attributes";'], + ['CSSProperties', 'interface CSSProperties { [key: string]: string | number };'], + ['HTMLWebViewElement', 'interface HTMLWebViewElement extends HTMLElement {};'], + ['ClassAttributes', 'interface ClassAttributes {};'], +]); + +/** + * Lines to manually comment out with single-line comments + */ +const COMMENT_OUT = [ + 'onChange', + 'onToggle', + 'export type ChangeEventHandler', + 'export type ReactEventHandler', + 'defaultChecked', + 'defaultValue', + 'suppressContentEditableWarning', + 'suppressHydrationWarning', +]; + +interface TypeNode { + name: string; + text: string; + usingTypes: string[]; +} + +interface IntrinsicElement { + tag: string; + attributesInterface: string; + elementInterface: string; +} diff --git a/scripts/jsx-types.unit.ts b/scripts/jsx-types.unit.ts new file mode 100644 index 00000000000..5642b0da6c4 --- /dev/null +++ b/scripts/jsx-types.unit.ts @@ -0,0 +1,70 @@ +import { getInterfaceOrType, getIntrinsicElements, parse } from './jsx-types'; + +describe('jsx-types', () => { + it('getInterfaceOrType, interface', () => { + const sf = parse(` + interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string | undefined; + target?: HTMLAttributeAnchorTarget; + type?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + } + `); + const i = getInterfaceOrType(sf, 'AnchorHTMLAttributes')!; + expect(i.name).toBe('AnchorHTMLAttributes'); + expect(i.text).toContain('interface AnchorHTMLAttributes extends HTMLAttributes'); + expect(i.usingTypes).toContain('HTMLAttributeAnchorTarget'); + expect(i.usingTypes).toContain('HTMLAttributeReferrerPolicy'); + }); + + it('getInterfaceOrType, type', () => { + const sf = parse(` + type HTMLAttributeAnchorTarget = + | '_self' + | '_blank' + | '_parent' + | '_top' + | (string & {}); + `); + const t = getInterfaceOrType(sf, 'HTMLAttributeAnchorTarget')!; + expect(t.name).toBe('HTMLAttributeAnchorTarget'); + expect(t.text).toContain('type HTMLAttributeAnchorTarget'); + expect(t.usingTypes).toHaveLength(0); + }); + + it('getInterfaceOrType, usingTypes from extends', () => { + const sf = parse(` + interface HTMLAttributes extends AriaAttributes, DOMAttributes {} + `); + const t = getInterfaceOrType(sf, 'HTMLAttributes')!; + expect(t.usingTypes).toHaveLength(2); + expect(t.usingTypes[0]).toBe('AriaAttributes'); + expect(t.usingTypes[1]).toBe('DOMAttributes'); + }); + + it('getIntrinsicElements', () => { + const sf = parse(` + declare global { + namespace JSX { + interface IntrinsicElements { + a: React.DetailedHTMLProps, HTMLAnchorElement>; + abbr: React.DetailedHTMLProps, HTMLElement>; + svg: React.SVGProps; + } + } + } + `); + const elements = getIntrinsicElements(sf); + expect(elements).toHaveLength(3); + expect(elements[0].tag).toBe('a'); + expect(elements[0].attributesInterface).toBe('AnchorHTMLAttributes'); + expect(elements[0].elementInterface).toBe('HTMLAnchorElement'); + expect(elements[1].tag).toBe('abbr'); + expect(elements[1].attributesInterface).toBe('HTMLAttributes'); + expect(elements[1].elementInterface).toBe('HTMLElement'); + expect(elements[2].tag).toBe('svg'); + expect(elements[2].attributesInterface).toBe('SVGProps'); + expect(elements[2].elementInterface).toBe('SVGSVGElement'); + }); +}); diff --git a/scripts/util.ts b/scripts/util.ts index 0ee20a27ec9..c56c7e37f06 100644 --- a/scripts/util.ts +++ b/scripts/util.ts @@ -28,6 +28,7 @@ export interface BuildConfig { tscDir: string; pkgDir: string; dev?: boolean; + jsx?: boolean; watch?: boolean; } diff --git a/src/core/api.md b/src/core/api.md index c4be89360fd..fa2747900af 100644 --- a/src/core/api.md +++ b/src/core/api.md @@ -222,1257 +222,88 @@ export namespace h { export function h(sel: any, data: any | null, children: JSXNode): JSXNode; // (undocumented) export namespace JSX { - // Warning: (ae-incompatible-release-tags) The symbol "IntrinsicElements" is marked as @public, but its signature references "JSXInternal" which is marked as @internal - // // (undocumented) - export interface IntrinsicElements extends JSXInternal.IntrinsicElements { - // (undocumented) - [tagName: string]: any; + export interface Element extends QwikJSX.Element { } - } -} - -// Warning: (ae-incompatible-release-tags) The symbol "Host" is marked as @public, but its signature references "JSXInternal" which is marked as @internal -// -// @public -export const Host: FunctionComponent>; - -// @public -export type HostElements = Element[]; - -// @public -export interface InjectedFunction { - $debugStack?: Error; - $inject: Providers; - $thisType: ConcreteType | null; - (this: SELF, ...args: [...ARGS, ...REST]): RET; -} - -// @public -export function injectEventHandler(...args: [ - { - $templateQRL: QRL; - new (hostElement: Element, props: any, state: any): SELF; - } | null, - ...ARGS, - (this: SELF, ...args: [...ProviderReturns]) => RET -]): EventHandler; - -// @public -export function injectFunction(...args: [...ARGS, (...args: [...ProviderReturns, ...REST]) => RET]): InjectedFunction; - -// @public -export function injectMethod(...args: [ - ConcreteType, - ...ARGS, - (this: SELF, ...args: [...ProviderReturns, ...REST]) => RET -]): InjectedFunction; - -// @public -export interface Injector { - readonly element: Element; - elementProps: Props; - getComponent>(componentType: ComponentConstructor): Promise; - getEntity>(entityKey: EntityKey, state?: EntityStateOf, entityType?: EntityConstructor): EntityPromise; - getEntityState>(propsOrKey: EntityPropsOf | EntityKey): Promise>; - getParent(): Injector | null; - invoke(fn: InjectedFunction, self?: SELF | null, ...rest: REST): Promise; - releaseEntity(key: EntityKey): void; - serialize(): void; -} - -// Warning: (ae-incompatible-release-tags) The symbol "jsx" is marked as @public, but its signature references "JSXInternal" which is marked as @internal -// -// @public (undocumented) -function jsx(type: string | FunctionComponent, props: JSXInternal.SVGAttributes & JSXInternal.HTMLAttributes & Record & { - children?: ComponentChild[] | ComponentChild; -}, key?: string): JSXNodeImpl>; - -export { jsx } - -export { jsx as jsxDEV } - -export { jsx as jsxs } - -// @public -export function jsxDeclareComponent

(componentTemplateQrl: QRL, tagName?: string, hostProps?: { - [property: string]: string | QRL; -}): (props: P & any) => JSXNode; - -// @public (undocumented) -export type JSXFactory = (props: { - [key: string]: any; -}) => JSXNode; - -// Warning: (ae-internal-missing-underscore) The name "JSXInternal" should be prefixed with an underscore because the declaration is marked as @internal -// -// @internal (undocumented) -export namespace JSXInternal { - // Warning: (ae-forgotten-export) The symbol "JSXDOMEvents" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "JSXBase" needs to be exported by the entry point index.d.ts - // - // (undocumented) - export interface DOMAttributes extends JSXDOMEvents, JSXBase { - } - // (undocumented) - export interface HTMLAttributes extends DOMAttributes { - // (undocumented) - about?: string; - // (undocumented) - accept?: string; - // (undocumented) - acceptCharset?: string; - // (undocumented) - accessKey?: string; - // (undocumented) - action?: string; - // (undocumented) - allowFullScreen?: boolean; - // (undocumented) - allowTransparency?: boolean; - // (undocumented) - alt?: string; - // (undocumented) - as?: string; - // (undocumented) - async?: boolean; - // (undocumented) - autoComplete?: string; - // (undocumented) - autocomplete?: string; - // (undocumented) - autoCorrect?: string; - // (undocumented) - autocorrect?: string; - // (undocumented) - autoFocus?: boolean; - // (undocumented) - autofocus?: boolean; - // (undocumented) - autoPlay?: boolean; - // (undocumented) - capture?: boolean | string; - // (undocumented) - cellPadding?: number | string; - // (undocumented) - cellSpacing?: number | string; - // (undocumented) - challenge?: string; - // (undocumented) - charSet?: string; - // (undocumented) - checked?: boolean; - // (undocumented) - class?: string | { - [className: string]: boolean; - }; - // (undocumented) - className?: string; - // (undocumented) - cols?: number; - // (undocumented) - colSpan?: number; - // (undocumented) - content?: string; - // (undocumented) - contentEditable?: boolean; - // (undocumented) - contextMenu?: string; - // (undocumented) - controls?: boolean; - // (undocumented) - controlsList?: string; - // (undocumented) - coords?: string; - // (undocumented) - crossOrigin?: string; - // (undocumented) - data?: string; - // (undocumented) - datatype?: string; - // (undocumented) - dateTime?: string; - // (undocumented) - decoding?: 'sync' | 'async' | 'auto'; - // (undocumented) - default?: boolean; - // (undocumented) - defer?: boolean; - // (undocumented) - dir?: 'auto' | 'rtl' | 'ltr'; - // (undocumented) - disabled?: boolean; - // (undocumented) - disableRemotePlayback?: boolean; - // (undocumented) - download?: any; - // (undocumented) - draggable?: boolean; - // (undocumented) - encType?: string; - // (undocumented) - events?: string[]; - // (undocumented) - for?: string; - // (undocumented) - form?: string; - // (undocumented) - formAction?: string; - // (undocumented) - formEncType?: string; - // (undocumented) - formMethod?: string; - // (undocumented) - formNoValidate?: boolean; - // (undocumented) - formTarget?: string; - // (undocumented) - frameBorder?: number | string; - // (undocumented) - headers?: string; - // (undocumented) - height?: number | string; - // (undocumented) - hidden?: boolean; - // (undocumented) - high?: number; - // (undocumented) - href?: string; - // (undocumented) - hrefLang?: string; - // (undocumented) - htmlFor?: string; - // (undocumented) - httpEquiv?: string; - // (undocumented) - icon?: string; - // (undocumented) - id?: string; - // (undocumented) - inlist?: any; - // (undocumented) - innerHTML?: string; - // (undocumented) - innerText?: string; - // (undocumented) - inputMode?: string; - // (undocumented) - integrity?: string; - // (undocumented) - is?: string; - // (undocumented) - itemID?: string; - // (undocumented) - itemProp?: string; - // (undocumented) - itemRef?: string; - // (undocumented) - itemScope?: boolean; - // (undocumented) - itemType?: string; - // (undocumented) - keyParams?: string; - // (undocumented) - keyType?: string; - // (undocumented) - kind?: string; - // (undocumented) - label?: string; - // (undocumented) - lang?: string; - // (undocumented) - list?: string; - // (undocumented) - loading?: 'eager' | 'lazy'; - // (undocumented) - loop?: boolean; - // (undocumented) - low?: number; - // (undocumented) - manifest?: string; - // (undocumented) - marginHeight?: number; - // (undocumented) - marginWidth?: number; - // (undocumented) - max?: number | string; - // (undocumented) - maxLength?: number; - // (undocumented) - media?: string; - // (undocumented) - mediaGroup?: string; - // (undocumented) - method?: string; - // (undocumented) - min?: number | string; - // (undocumented) - minLength?: number; - // (undocumented) - multiple?: boolean; - // (undocumented) - muted?: boolean; - // (undocumented) - name?: string; - // (undocumented) - nonce?: string; - // (undocumented) - noValidate?: boolean; - // (undocumented) - open?: boolean; - // (undocumented) - optimum?: number; - // (undocumented) - pattern?: string; - // (undocumented) - placeholder?: string; - // (undocumented) - playsInline?: boolean; - // (undocumented) - poster?: string; - // (undocumented) - prefix?: string; - // (undocumented) - preload?: string; - // (undocumented) - property?: string; - // (undocumented) - radioGroup?: string; - // (undocumented) - readOnly?: boolean; - // (undocumented) - readonly?: boolean; - // (undocumented) - rel?: string; - // (undocumented) - required?: boolean; - // (undocumented) - resource?: string; - // (undocumented) - role?: string; - // (undocumented) - rows?: number; - // (undocumented) - rowSpan?: number; - // (undocumented) - sandbox?: string; - // (undocumented) - scope?: string; - // (undocumented) - scoped?: boolean; - // (undocumented) - scrolling?: string; - // (undocumented) - seamless?: boolean; - // (undocumented) - selected?: boolean; - // (undocumented) - shape?: string; - // (undocumented) - size?: number; - // (undocumented) - sizes?: string; - // (undocumented) - slot?: string; - // (undocumented) - span?: number; - // (undocumented) - spellcheck?: boolean; - // (undocumented) - src?: string; - // (undocumented) - srcDoc?: string; - // (undocumented) - srcLang?: string; - // (undocumented) - srcSet?: string; - // (undocumented) - srcset?: string; - // (undocumented) - start?: number; - // (undocumented) - step?: number | string; - // (undocumented) - style?: string; - // (undocumented) - summary?: string; - // (undocumented) - tabIndex?: number; - // (undocumented) - target?: string; - // (undocumented) - title?: string; - // (undocumented) - type?: string; - // (undocumented) - typeof?: string; - // (undocumented) - useMap?: string; - // (undocumented) - value?: string | string[] | number; - // (undocumented) - vocab?: string; - // (undocumented) - volume?: string | number; - // (undocumented) - width?: number | string; - // (undocumented) - wmode?: string; - // (undocumented) - wrap?: string; - } - // (undocumented) - export interface HTMLMarqueeElement extends HTMLElement { - // (undocumented) - behavior?: 'scroll' | 'slide' | 'alternate'; - // (undocumented) - bgColor?: string; - // (undocumented) - direction?: 'left' | 'right' | 'up' | 'down'; - // (undocumented) - height?: number | string; - // (undocumented) - hspace?: number | string; - // (undocumented) - loop?: number | string; - // (undocumented) - scrollAmount?: number | string; - // (undocumented) - scrollDelay?: number | string; - // (undocumented) - trueSpeed?: boolean; - // (undocumented) - vspace?: number | string; - // (undocumented) - width?: number | string; - } - // (undocumented) - export interface IntrinsicAttributes { - // (undocumented) - key?: any; - } - // (undocumented) - export interface IntrinsicElements { - // (undocumented) - [tag: string]: any; - // (undocumented) - a: HTMLAttributes; - // (undocumented) - abbr: HTMLAttributes; - // (undocumented) - address: HTMLAttributes; - // (undocumented) - animate: SVGAttributes; - // (undocumented) - animateTransform: SVGAttributes; - // (undocumented) - area: HTMLAttributes; - // (undocumented) - article: HTMLAttributes; - // (undocumented) - aside: HTMLAttributes; - // (undocumented) - audio: HTMLAttributes; - // (undocumented) - b: HTMLAttributes; - // (undocumented) - base: HTMLAttributes; - // (undocumented) - bdi: HTMLAttributes; - // (undocumented) - bdo: HTMLAttributes; - // (undocumented) - big: HTMLAttributes; - // (undocumented) - blockquote: HTMLAttributes; - // (undocumented) - body: HTMLAttributes; - // (undocumented) - br: HTMLAttributes; - // (undocumented) - button: HTMLAttributes; - // (undocumented) - canvas: HTMLAttributes; - // (undocumented) - caption: HTMLAttributes; - // (undocumented) - circle: SVGAttributes; - // (undocumented) - cite: HTMLAttributes; - // (undocumented) - clipPath: SVGAttributes; - // (undocumented) - code: HTMLAttributes; - // (undocumented) - col: HTMLAttributes; - // (undocumented) - colgroup: HTMLAttributes; - // (undocumented) - data: HTMLAttributes; - // (undocumented) - datalist: HTMLAttributes; - // (undocumented) - dd: HTMLAttributes; - // (undocumented) - defs: SVGAttributes; - // (undocumented) - del: HTMLAttributes; - // (undocumented) - desc: SVGAttributes; - // (undocumented) - details: HTMLAttributes; - // (undocumented) - dfn: HTMLAttributes; - // (undocumented) - dialog: HTMLAttributes; - // (undocumented) - div: HTMLAttributes; - // (undocumented) - dl: HTMLAttributes; - // (undocumented) - dt: HTMLAttributes; - // (undocumented) - ellipse: SVGAttributes; - // (undocumented) - em: HTMLAttributes; - // (undocumented) - embed: HTMLAttributes; - // (undocumented) - feBlend: SVGAttributes; - // (undocumented) - feColorMatrix: SVGAttributes; - // (undocumented) - feComponentTransfer: SVGAttributes; - // (undocumented) - feComposite: SVGAttributes; - // (undocumented) - feConvolveMatrix: SVGAttributes; - // (undocumented) - feDiffuseLighting: SVGAttributes; - // (undocumented) - feDisplacementMap: SVGAttributes; - // (undocumented) - feDropShadow: SVGAttributes; - // (undocumented) - feFlood: SVGAttributes; - // (undocumented) - feFuncA: SVGAttributes; - // (undocumented) - feFuncB: SVGAttributes; - // (undocumented) - feFuncG: SVGAttributes; - // (undocumented) - feFuncR: SVGAttributes; - // (undocumented) - feGaussianBlur: SVGAttributes; - // (undocumented) - feImage: SVGAttributes; - // (undocumented) - feMerge: SVGAttributes; - // (undocumented) - feMergeNode: SVGAttributes; - // (undocumented) - feMorphology: SVGAttributes; - // (undocumented) - feOffset: SVGAttributes; - // (undocumented) - feSpecularLighting: SVGAttributes; - // (undocumented) - feTile: SVGAttributes; - // (undocumented) - feTurbulence: SVGAttributes; - // (undocumented) - fieldset: HTMLAttributes; - // (undocumented) - figcaption: HTMLAttributes; - // (undocumented) - figure: HTMLAttributes; - // (undocumented) - filter: SVGAttributes; - // (undocumented) - footer: HTMLAttributes; - // (undocumented) - foreignObject: SVGAttributes; - // (undocumented) - form: HTMLAttributes; - // (undocumented) - g: SVGAttributes; - // (undocumented) - h1: HTMLAttributes; - // (undocumented) - h2: HTMLAttributes; - // (undocumented) - h3: HTMLAttributes; - // (undocumented) - h4: HTMLAttributes; - // (undocumented) - h5: HTMLAttributes; - // (undocumented) - h6: HTMLAttributes; - // (undocumented) - head: HTMLAttributes; - // (undocumented) - header: HTMLAttributes; - // (undocumented) - hgroup: HTMLAttributes; - // (undocumented) - hr: HTMLAttributes; - // (undocumented) - html: HTMLAttributes; - // (undocumented) - i: HTMLAttributes; - // (undocumented) - iframe: HTMLAttributes; - // (undocumented) - image: SVGAttributes; - // (undocumented) - img: HTMLAttributes; - // (undocumented) - input: HTMLAttributes; - // (undocumented) - ins: HTMLAttributes; - // (undocumented) - kbd: HTMLAttributes; - // (undocumented) - keygen: HTMLAttributes; - // (undocumented) - label: HTMLAttributes; - // (undocumented) - legend: HTMLAttributes; - // (undocumented) - li: HTMLAttributes; - // (undocumented) - line: SVGAttributes; - // (undocumented) - linearGradient: SVGAttributes; - // (undocumented) - link: HTMLAttributes; - // (undocumented) - main: HTMLAttributes; - // (undocumented) - map: HTMLAttributes; - // (undocumented) - mark: HTMLAttributes; - // (undocumented) - marker: SVGAttributes; - // (undocumented) - marquee: HTMLAttributes; - // (undocumented) - mask: SVGAttributes; - // (undocumented) - menu: HTMLAttributes; - // (undocumented) - menuitem: HTMLAttributes; - // (undocumented) - meta: HTMLAttributes; - // (undocumented) - meter: HTMLAttributes; - // (undocumented) - nav: HTMLAttributes; - // (undocumented) - noscript: HTMLAttributes; - // (undocumented) - object: HTMLAttributes; - // (undocumented) - ol: HTMLAttributes; - // (undocumented) - optgroup: HTMLAttributes; - // (undocumented) - option: HTMLAttributes; - // (undocumented) - output: HTMLAttributes; - // (undocumented) - p: HTMLAttributes; - // (undocumented) - param: HTMLAttributes; - // (undocumented) - path: SVGAttributes; - // (undocumented) - pattern: SVGAttributes; - // (undocumented) - picture: HTMLAttributes; - // (undocumented) - polygon: SVGAttributes; - // (undocumented) - polyline: SVGAttributes; - // (undocumented) - pre: HTMLAttributes; - // (undocumented) - progress: HTMLAttributes; - // (undocumented) - q: HTMLAttributes; - // (undocumented) - radialGradient: SVGAttributes; - // (undocumented) - rect: SVGAttributes; - // (undocumented) - rp: HTMLAttributes; - // (undocumented) - rt: HTMLAttributes; - // (undocumented) - ruby: HTMLAttributes; - // (undocumented) - s: HTMLAttributes; - // (undocumented) - samp: HTMLAttributes; - // (undocumented) - script: HTMLAttributes; - // (undocumented) - section: HTMLAttributes; - // (undocumented) - select: HTMLAttributes; - // (undocumented) - slot: HTMLAttributes; - // (undocumented) - small: HTMLAttributes; - // (undocumented) - source: HTMLAttributes; - // (undocumented) - span: HTMLAttributes; - // (undocumented) - stop: SVGAttributes; - // (undocumented) - strong: HTMLAttributes; - // (undocumented) - style: HTMLAttributes; - // (undocumented) - sub: HTMLAttributes; - // (undocumented) - summary: HTMLAttributes; - // (undocumented) - sup: HTMLAttributes; - // (undocumented) - svg: SVGAttributes; - // (undocumented) - symbol: SVGAttributes; - // (undocumented) - table: HTMLAttributes; - // (undocumented) - tbody: HTMLAttributes; - // (undocumented) - td: HTMLAttributes; - // (undocumented) - text: SVGAttributes; - // (undocumented) - textarea: HTMLAttributes; - // (undocumented) - tfoot: HTMLAttributes; - // (undocumented) - th: HTMLAttributes; - // (undocumented) - thead: HTMLAttributes; - // (undocumented) - time: HTMLAttributes; - // (undocumented) - title: HTMLAttributes; - // (undocumented) - tr: HTMLAttributes; - // (undocumented) - track: HTMLAttributes; - // (undocumented) - tspan: SVGAttributes; - // (undocumented) - u: HTMLAttributes; - // (undocumented) - ul: HTMLAttributes; - // (undocumented) - use: SVGAttributes; - // (undocumented) - var: HTMLAttributes; - // (undocumented) - video: HTMLAttributes; - // (undocumented) - wbr: HTMLAttributes; - } - // (undocumented) - export interface PathAttributes { - // (undocumented) - d: string; - } - // (undocumented) - export interface SVGAttributes extends HTMLAttributes { - // (undocumented) - accentHeight?: number | string; - // (undocumented) - accumulate?: 'none' | 'sum'; - // (undocumented) - additive?: 'replace' | 'sum'; - // (undocumented) - alignmentBaseline?: 'auto' | 'baseline' | 'before-edge' | 'text-before-edge' | 'middle' | 'central' | 'after-edge' | 'text-after-edge' | 'ideographic' | 'alphabetic' | 'hanging' | 'mathematical' | 'inherit'; - // (undocumented) - allowReorder?: 'no' | 'yes'; - // (undocumented) - alphabetic?: number | string; - // (undocumented) - amplitude?: number | string; - // (undocumented) - arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated'; - // (undocumented) - ascent?: number | string; - // (undocumented) - attributeName?: string; - // (undocumented) - attributeType?: string; - // (undocumented) - autoReverse?: number | string; - // (undocumented) - azimuth?: number | string; - // (undocumented) - baseFrequency?: number | string; - // (undocumented) - baselineShift?: number | string; - // (undocumented) - baseProfile?: number | string; - // (undocumented) - bbox?: number | string; - // (undocumented) - begin?: number | string; - // (undocumented) - bias?: number | string; - // (undocumented) - by?: number | string; - // (undocumented) - calcMode?: number | string; - // (undocumented) - capHeight?: number | string; - // (undocumented) - clip?: number | string; - // (undocumented) - clipPath?: string; - // (undocumented) - clipPathUnits?: number | string; - // (undocumented) - clipRule?: number | string; - // (undocumented) - colorInterpolation?: number | string; - // (undocumented) - colorInterpolationFilters?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit'; - // (undocumented) - colorProfile?: number | string; - // (undocumented) - colorRendering?: number | string; - // (undocumented) - contentScriptType?: number | string; - // (undocumented) - contentStyleType?: number | string; - // (undocumented) - cursor?: number | string; - // (undocumented) - cx?: number | string; - // (undocumented) - cy?: number | string; - // (undocumented) - d?: string; - // (undocumented) - decelerate?: number | string; - // (undocumented) - descent?: number | string; - // (undocumented) - diffuseConstant?: number | string; - // (undocumented) - direction?: number | string; - // (undocumented) - display?: number | string; - // (undocumented) - divisor?: number | string; - // (undocumented) - dominantBaseline?: number | string; - // (undocumented) - dur?: number | string; - // (undocumented) - dx?: number | string; - // (undocumented) - dy?: number | string; - // (undocumented) - edgeMode?: number | string; - // (undocumented) - elevation?: number | string; - // (undocumented) - enableBackground?: number | string; - // (undocumented) - end?: number | string; - // (undocumented) - exponent?: number | string; - // (undocumented) - externalResourcesRequired?: number | string; - // (undocumented) - fill?: string; - // (undocumented) - fillOpacity?: number | string; - // (undocumented) - fillRule?: 'nonzero' | 'evenodd' | 'inherit'; - // (undocumented) - filter?: string; - // (undocumented) - filterRes?: number | string; - // (undocumented) - filterUnits?: number | string; - // (undocumented) - floodColor?: number | string; - // (undocumented) - floodOpacity?: number | string; - // (undocumented) - focusable?: number | string; - // (undocumented) - fontFamily?: string; // (undocumented) - fontSize?: number | string; - // (undocumented) - fontSizeAdjust?: number | string; - // (undocumented) - fontStretch?: number | string; - // (undocumented) - fontStyle?: number | string; - // (undocumented) - fontVariant?: number | string; - // (undocumented) - fontWeight?: number | string; - // (undocumented) - format?: number | string; - // (undocumented) - from?: number | string; - // (undocumented) - fx?: number | string; - // (undocumented) - fy?: number | string; - // (undocumented) - g1?: number | string; - // (undocumented) - g2?: number | string; - // (undocumented) - glyphName?: number | string; - // (undocumented) - glyphOrientationHorizontal?: number | string; - // (undocumented) - glyphOrientationVertical?: number | string; - // (undocumented) - glyphRef?: number | string; - // (undocumented) - gradientTransform?: string; - // (undocumented) - gradientUnits?: string; - // (undocumented) - hanging?: number | string; - // (undocumented) - horizAdvX?: number | string; - // (undocumented) - horizOriginX?: number | string; - // (undocumented) - ideographic?: number | string; - // (undocumented) - imageRendering?: number | string; - // (undocumented) - in?: string; - // (undocumented) - in2?: number | string; - // (undocumented) - intercept?: number | string; - // (undocumented) - k?: number | string; - // (undocumented) - k1?: number | string; - // (undocumented) - k2?: number | string; - // (undocumented) - k3?: number | string; - // (undocumented) - k4?: number | string; - // (undocumented) - kernelMatrix?: number | string; - // (undocumented) - kernelUnitLength?: number | string; - // (undocumented) - kerning?: number | string; - // (undocumented) - keyPoints?: number | string; - // (undocumented) - keySplines?: number | string; - // (undocumented) - keyTimes?: number | string; - // (undocumented) - lengthAdjust?: number | string; - // (undocumented) - letterSpacing?: number | string; - // (undocumented) - lightingColor?: number | string; - // (undocumented) - limitingConeAngle?: number | string; - // (undocumented) - local?: number | string; - // (undocumented) - markerEnd?: string; - // (undocumented) - markerHeight?: number | string; - // (undocumented) - markerMid?: string; - // (undocumented) - markerStart?: string; - // (undocumented) - markerUnits?: number | string; - // (undocumented) - markerWidth?: number | string; - // (undocumented) - mask?: string; - // (undocumented) - maskContentUnits?: number | string; - // (undocumented) - maskUnits?: number | string; - // (undocumented) - mathematical?: number | string; - // (undocumented) - mode?: number | string; - // (undocumented) - numOctaves?: number | string; - // (undocumented) - offset?: number | string; - // (undocumented) - opacity?: number | string; - // (undocumented) - operator?: number | string; - // (undocumented) - order?: number | string; - // (undocumented) - orient?: number | string; - // (undocumented) - orientation?: number | string; - // (undocumented) - origin?: number | string; - // (undocumented) - overflow?: number | string; - // (undocumented) - overlinePosition?: number | string; - // (undocumented) - overlineThickness?: number | string; - // (undocumented) - paintOrder?: number | string; - // (undocumented) - panose1?: number | string; - // (undocumented) - pathLength?: number | string; - // (undocumented) - patternContentUnits?: string; - // (undocumented) - patternTransform?: number | string; - // (undocumented) - patternUnits?: string; - // (undocumented) - pointerEvents?: number | string; - // (undocumented) - points?: string; - // (undocumented) - pointsAtX?: number | string; - // (undocumented) - pointsAtY?: number | string; - // (undocumented) - pointsAtZ?: number | string; - // (undocumented) - preserveAlpha?: number | string; - // (undocumented) - preserveAspectRatio?: string; - // (undocumented) - primitiveUnits?: number | string; - // (undocumented) - r?: number | string; - // (undocumented) - radius?: number | string; - // (undocumented) - refX?: number | string; - // (undocumented) - refY?: number | string; - // (undocumented) - renderingIntent?: number | string; - // (undocumented) - repeatCount?: number | string; - // (undocumented) - repeatDur?: number | string; - // (undocumented) - requiredExtensions?: number | string; - // (undocumented) - requiredFeatures?: number | string; - // (undocumented) - restart?: number | string; - // (undocumented) - result?: string; - // (undocumented) - rotate?: number | string; - // (undocumented) - rx?: number | string; - // (undocumented) - ry?: number | string; - // (undocumented) - scale?: number | string; - // (undocumented) - seed?: number | string; - // (undocumented) - shapeRendering?: number | string; - // (undocumented) - slope?: number | string; - // (undocumented) - spacing?: number | string; - // (undocumented) - specularConstant?: number | string; - // (undocumented) - specularExponent?: number | string; - // (undocumented) - speed?: number | string; - // (undocumented) - spreadMethod?: string; - // (undocumented) - startOffset?: number | string; - // (undocumented) - stdDeviation?: number | string; - // (undocumented) - stemh?: number | string; - // (undocumented) - stemv?: number | string; - // (undocumented) - stitchTiles?: number | string; - // (undocumented) - stopColor?: string; - // (undocumented) - stopOpacity?: number | string; - // (undocumented) - strikethroughPosition?: number | string; - // (undocumented) - strikethroughThickness?: number | string; - // (undocumented) - string?: number | string; - // (undocumented) - stroke?: string; - // (undocumented) - strokeDasharray?: string | number; - // (undocumented) - strokeDashoffset?: string | number; - // (undocumented) - strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit'; - // (undocumented) - strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit'; - // (undocumented) - strokeMiterlimit?: string | number; - // (undocumented) - strokeOpacity?: number | string; - // (undocumented) - strokeWidth?: number | string; - // (undocumented) - surfaceScale?: number | string; - // (undocumented) - systemLanguage?: number | string; - // (undocumented) - tableValues?: number | string; - // (undocumented) - targetX?: number | string; - // (undocumented) - targetY?: number | string; - // (undocumented) - textAnchor?: string; - // (undocumented) - textDecoration?: number | string; - // (undocumented) - textLength?: number | string; - // (undocumented) - textRendering?: number | string; - // (undocumented) - to?: number | string; - // (undocumented) - transform?: string; - // (undocumented) - u1?: number | string; - // (undocumented) - u2?: number | string; - // (undocumented) - underlinePosition?: number | string; - // (undocumented) - underlineThickness?: number | string; - // (undocumented) - unicode?: number | string; - // (undocumented) - unicodeBidi?: number | string; - // (undocumented) - unicodeRange?: number | string; - // (undocumented) - unitsPerEm?: number | string; - // (undocumented) - vAlphabetic?: number | string; - // (undocumented) - values?: string; - // (undocumented) - vectorEffect?: number | string; - // (undocumented) - version?: string; - // (undocumented) - vertAdvY?: number | string; - // (undocumented) - vertOriginX?: number | string; - // (undocumented) - vertOriginY?: number | string; - // (undocumented) - vHanging?: number | string; - // (undocumented) - vIdeographic?: number | string; - // (undocumented) - viewBox?: string; - // (undocumented) - viewTarget?: number | string; - // (undocumented) - visibility?: number | string; - // (undocumented) - vMathematical?: number | string; - // (undocumented) - widths?: number | string; - // (undocumented) - wordSpacing?: number | string; - // (undocumented) - writingMode?: number | string; - // (undocumented) - x?: number | string; - // (undocumented) - x1?: number | string; - // (undocumented) - x2?: number | string; - // (undocumented) - xChannelSelector?: string; - // (undocumented) - xHeight?: number | string; - // (undocumented) - xlinkActuate?: string; - // (undocumented) - xlinkArcrole?: string; - // (undocumented) - xlinkHref?: string; - // (undocumented) - xlinkRole?: string; - // (undocumented) - xlinkShow?: string; - // (undocumented) - xlinkTitle?: string; - // (undocumented) - xlinkType?: string; - // (undocumented) - xmlBase?: string; - // (undocumented) - xmlLang?: string; - // (undocumented) - xmlns?: string; - // (undocumented) - xmlnsXlink?: string; - // (undocumented) - xmlSpace?: string; - // (undocumented) - y?: number | string; - // (undocumented) - y1?: number | string; - // (undocumented) - y2?: number | string; - // (undocumented) - yChannelSelector?: string; - // (undocumented) - z?: number | string; + export interface IntrinsicAttributes extends QwikJSX.IntrinsicAttributes { + } // (undocumented) - zoomAndPan?: string; + export interface IntrinsicElements extends QwikJSX.IntrinsicElements { + } } - {}; } +// @public +export const Host: FunctionComponent>; + +// @public +export type HostElements = Element[]; + +// @public +export interface InjectedFunction { + $debugStack?: Error; + $inject: Providers; + $thisType: ConcreteType | null; + (this: SELF, ...args: [...ARGS, ...REST]): RET; +} + +// @public +export function injectEventHandler(...args: [ + { + $templateQRL: QRL; + new (hostElement: Element, props: any, state: any): SELF; + } | null, + ...ARGS, + (this: SELF, ...args: [...ProviderReturns]) => RET +]): EventHandler; + +// @public +export function injectFunction(...args: [...ARGS, (...args: [...ProviderReturns, ...REST]) => RET]): InjectedFunction; + +// @public +export function injectMethod(...args: [ + ConcreteType, + ...ARGS, + (this: SELF, ...args: [...ProviderReturns, ...REST]) => RET +]): InjectedFunction; + +// @public +export interface Injector { + readonly element: Element; + elementProps: Props; + getComponent>(componentType: ComponentConstructor): Promise; + getEntity>(entityKey: EntityKey, state?: EntityStateOf, entityType?: EntityConstructor): EntityPromise; + getEntityState>(propsOrKey: EntityPropsOf | EntityKey): Promise>; + getParent(): Injector | null; + invoke(fn: InjectedFunction, self?: SELF | null, ...rest: REST): Promise; + releaseEntity(key: EntityKey): void; + serialize(): void; +} + +// Warning: (ae-forgotten-export) The symbol "QwikDOMAttributes" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +function jsx(type: string | FunctionComponent, props: QwikDOMAttributes & Record & { + children?: ComponentChild[] | ComponentChild; +}, key?: string): JSXNodeImpl>; + +export { jsx } + +export { jsx as jsxDEV } + +export { jsx as jsxs } + +// @public +export function jsxDeclareComponent

(componentTemplateQrl: QRL, tagName?: string, hostProps?: { + [property: string]: string | QRL; +}): (props: P & any) => JSXNode; + +// @public (undocumented) +export type JSXFactory = (props: { + [key: string]: any; +}) => JSXNode; + // @public (undocumented) export interface JSXNode { // (undocumented) @@ -1560,6 +391,23 @@ export interface QRL { __brand__T__: T; } +// @public (undocumented) +export namespace QwikJSX { + // (undocumented) + export interface Element extends JSXNode { + } + // (undocumented) + export interface IntrinsicAttributes { + // (undocumented) + [key: string]: any; + } + // Warning: (ae-forgotten-export) The symbol "QwikIntrinsicElements" needs to be exported by the entry point index.d.ts + // + // (undocumented) + export interface IntrinsicElements extends QwikIntrinsicElements { + } +} + // @public (undocumented) export type RenderableProps = P & Readonly<{ children?: ComponentChildren; diff --git a/src/core/render/jsx/attributes.ts b/src/core/render/jsx/attributes.ts index dddcbb7ef94..2c90356ce33 100644 --- a/src/core/render/jsx/attributes.ts +++ b/src/core/render/jsx/attributes.ts @@ -11,7 +11,7 @@ import { assertValidDataKey } from '../../error/data'; import { AttributeMarker } from '../../util/markers'; import type { EntityConstructor } from '../../entity/entity'; import { QError, qError } from '../../error/error'; -import type { JSXBase } from './types/jsx_base'; +import type { QwikDOMAttributes } from './types'; /** * Apply Props to Element @@ -22,7 +22,7 @@ import type { JSXBase } from './types/jsx_base'; */ export function applyAttributes( element: Element, - props: Record | JSXBase | null, + props: Record | QwikDOMAttributes | null, detectChanges: boolean ): boolean { let changesDetected = false; diff --git a/src/core/render/jsx/factory.ts b/src/core/render/jsx/factory.ts index cd188501042..30f13c936a7 100644 --- a/src/core/render/jsx/factory.ts +++ b/src/core/render/jsx/factory.ts @@ -10,7 +10,7 @@ import type { QRL } from '../../import/qrl'; import { AttributeMarker } from '../../util/markers'; import { EMPTY_ARRAY } from '../../util/flyweight'; -import type { FunctionComponent, JSXNode, JSXInternal } from './types'; +import type { FunctionComponent, JSXNode, QwikJSX } from './types'; import { JSXNodeImpl } from './jsx-runtime'; import { flattenArray } from '../../util/array'; @@ -55,9 +55,9 @@ export declare namespace h { export function h(sel: any, data: any | null, children: JSXNode): JSXNode; export namespace JSX { - interface IntrinsicElements extends JSXInternal.IntrinsicElements { - [tagName: string]: any; - } + export interface Element extends QwikJSX.Element {} + export interface IntrinsicAttributes extends QwikJSX.IntrinsicAttributes {} + export interface IntrinsicElements extends QwikJSX.IntrinsicElements {} } } diff --git a/src/core/render/jsx/host.ts b/src/core/render/jsx/host.ts index bed750a3a97..ec5f5d1af1b 100644 --- a/src/core/render/jsx/host.ts +++ b/src/core/render/jsx/host.ts @@ -6,7 +6,6 @@ * found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE */ -import type { JSXInternal } from './types/jsx'; import type { FunctionComponent } from './types'; /** @@ -24,6 +23,4 @@ import type { FunctionComponent } from './types'; * servers that purpose. * @public */ -export const Host: FunctionComponent< - JSXInternal.HTMLAttributes | JSXInternal.SVGAttributes | Record -> = {} as any; +export const Host: FunctionComponent> = {} as any; diff --git a/src/core/render/jsx/index.ts b/src/core/render/jsx/index.ts index 49ff02865a0..878abd31ff8 100644 --- a/src/core/render/jsx/index.ts +++ b/src/core/render/jsx/index.ts @@ -14,9 +14,9 @@ export type { ComponentChildren, FunctionComponent, JSXFactory, - RenderableProps, JSXNode, + QwikJSX, + RenderableProps, } from './types'; export { Host } from './host'; export { jsx, jsxDEV, jsxs, Fragment } from './jsx-runtime'; -export type { JSXInternal } from './jsx-runtime'; diff --git a/src/core/render/jsx/jsx-runtime.ts b/src/core/render/jsx/jsx-runtime.ts index 5181ab63ba1..44fa55607fd 100644 --- a/src/core/render/jsx/jsx-runtime.ts +++ b/src/core/render/jsx/jsx-runtime.ts @@ -1,5 +1,11 @@ import { EMPTY_ARRAY } from '../../util/flyweight'; -import type { ComponentChild, FunctionComponent, JSXInternal, JSXNode } from './types'; +import type { + ComponentChild, + FunctionComponent, + JSXNode, + QwikDOMAttributes, + QwikJSX, +} from './types'; import { qDev } from '../../util/qdev'; /** @@ -7,9 +13,7 @@ import { qDev } from '../../util/qdev'; */ export function jsx( type: string | FunctionComponent, - props: JSXInternal.SVGAttributes & - JSXInternal.HTMLAttributes & - Record & { children?: ComponentChild[] | ComponentChild }, + props: QwikDOMAttributes & Record & { children?: ComponentChild[] | ComponentChild }, key?: string ) { return new JSXNodeImpl(type, props, key); @@ -50,7 +54,6 @@ export const isJSXNode = (n: any): n is JSXNode => { */ export const Fragment = {} as any; -export type { JSXInternal as JSX }; -export type { JSXInternal }; +export type { QwikJSX as JSX }; export { jsx as jsxs, jsx as jsxDEV }; diff --git a/src/core/render/jsx/types/index.ts b/src/core/render/jsx/types/index.ts index 76bbbab9b93..515de70b625 100644 --- a/src/core/render/jsx/types/index.ts +++ b/src/core/render/jsx/types/index.ts @@ -1,4 +1,3 @@ -export type { JSXInternal } from './jsx'; export type { ComponentChild, ComponentChildren, @@ -6,4 +5,6 @@ export type { JSXFactory, JSXNode, RenderableProps, -} from './jsx_node'; +} from './jsx-node'; +export type { QwikDOMAttributes, QwikJSX } from './jsx-qwik'; +export type { QwikIntrinsicElements } from './jsx-qwik-elements'; diff --git a/src/core/render/jsx/types/jsx-generated.ts b/src/core/render/jsx/types/jsx-generated.ts new file mode 100644 index 00000000000..f969f36a5b0 --- /dev/null +++ b/src/core/render/jsx/types/jsx-generated.ts @@ -0,0 +1,1217 @@ +/* eslint-disable */ +/* DO NOT EDIT!! Auto Generated from @types/react */ +/* Source: https://unpkg.com/@types/react@17.0.15/index.d.ts */ +/* See DEVELOPER.md on how to update */ + +import type { DOMAttributes } from './jsx-qwik-attributes'; +interface CSSProperties { + [key: string]: string | number; +} +interface HTMLWebViewElement extends HTMLElement {} +interface ClassAttributes {} +export interface AriaAttributes { + /** Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application. */ + 'aria-activedescendant'?: string | undefined; + /** Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute. */ + 'aria-atomic'?: boolean | 'false' | 'true' | undefined; + /** + * Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be + * presented if they are made. + */ + 'aria-autocomplete'?: 'none' | 'inline' | 'list' | 'both' | undefined; + /** Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. */ + 'aria-busy'?: boolean | 'false' | 'true' | undefined; + /** + * Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. + * @see aria-pressed @see aria-selected. + */ + 'aria-checked'?: boolean | 'false' | 'mixed' | 'true' | undefined; + /** + * Defines the total number of columns in a table, grid, or treegrid. + * @see aria-colindex. + */ + 'aria-colcount'?: number | undefined; + /** + * Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. + * @see aria-colcount @see aria-colspan. + */ + 'aria-colindex'?: number | undefined; + /** + * Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-colindex @see aria-rowspan. + */ + 'aria-colspan'?: number | undefined; + /** + * Identifies the element (or elements) whose contents or presence are controlled by the current element. + * @see aria-owns. + */ + 'aria-controls'?: string | undefined; + /** Indicates the element that represents the current item within a container or set of related elements. */ + 'aria-current'?: + | boolean + | 'false' + | 'true' + | 'page' + | 'step' + | 'location' + | 'date' + | 'time' + | undefined; + /** + * Identifies the element (or elements) that describes the object. + * @see aria-labelledby + */ + 'aria-describedby'?: string | undefined; + /** + * Identifies the element that provides a detailed, extended description for the object. + * @see aria-describedby. + */ + 'aria-details'?: string | undefined; + /** + * Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. + * @see aria-hidden @see aria-readonly. + */ + 'aria-disabled'?: boolean | 'false' | 'true' | undefined; + /** + * Indicates what functions can be performed when a dragged object is released on the drop target. + * @deprecated in ARIA 1.1 + */ + 'aria-dropeffect'?: 'none' | 'copy' | 'execute' | 'link' | 'move' | 'popup' | undefined; + /** + * Identifies the element that provides an error message for the object. + * @see aria-invalid @see aria-describedby. + */ + 'aria-errormessage'?: string | undefined; + /** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */ + 'aria-expanded'?: boolean | 'false' | 'true' | undefined; + /** + * Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, + * allows assistive technology to override the general default of reading in document source order. + */ + 'aria-flowto'?: string | undefined; + /** + * Indicates an element's "grabbed" state in a drag-and-drop operation. + * @deprecated in ARIA 1.1 + */ + 'aria-grabbed'?: boolean | 'false' | 'true' | undefined; + /** Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element. */ + 'aria-haspopup'?: + | boolean + | 'false' + | 'true' + | 'menu' + | 'listbox' + | 'tree' + | 'grid' + | 'dialog' + | undefined; + /** + * Indicates whether the element is exposed to an accessibility API. + * @see aria-disabled. + */ + 'aria-hidden'?: boolean | 'false' | 'true' | undefined; + /** + * Indicates the entered value does not conform to the format expected by the application. + * @see aria-errormessage. + */ + 'aria-invalid'?: boolean | 'false' | 'true' | 'grammar' | 'spelling' | undefined; + /** Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element. */ + 'aria-keyshortcuts'?: string | undefined; + /** + * Defines a string value that labels the current element. + * @see aria-labelledby. + */ + 'aria-label'?: string | undefined; + /** + * Identifies the element (or elements) that labels the current element. + * @see aria-describedby. + */ + 'aria-labelledby'?: string | undefined; + /** Defines the hierarchical level of an element within a structure. */ + 'aria-level'?: number | undefined; + /** Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region. */ + 'aria-live'?: 'off' | 'assertive' | 'polite' | undefined; + /** Indicates whether an element is modal when displayed. */ + 'aria-modal'?: boolean | 'false' | 'true' | undefined; + /** Indicates whether a text box accepts multiple lines of input or only a single line. */ + 'aria-multiline'?: boolean | 'false' | 'true' | undefined; + /** Indicates that the user may select more than one item from the current selectable descendants. */ + 'aria-multiselectable'?: boolean | 'false' | 'true' | undefined; + /** Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous. */ + 'aria-orientation'?: 'horizontal' | 'vertical' | undefined; + /** + * Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship + * between DOM elements where the DOM hierarchy cannot be used to represent the relationship. + * @see aria-controls. + */ + 'aria-owns'?: string | undefined; + /** + * Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. + * A hint could be a sample value or a brief description of the expected format. + */ + 'aria-placeholder'?: string | undefined; + /** + * Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-setsize. + */ + 'aria-posinset'?: number | undefined; + /** + * Indicates the current "pressed" state of toggle buttons. + * @see aria-checked @see aria-selected. + */ + 'aria-pressed'?: boolean | 'false' | 'mixed' | 'true' | undefined; + /** + * Indicates that the element is not editable, but is otherwise operable. + * @see aria-disabled. + */ + 'aria-readonly'?: boolean | 'false' | 'true' | undefined; + /** + * Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified. + * @see aria-atomic. + */ + 'aria-relevant'?: + | 'additions' + | 'additions removals' + | 'additions text' + | 'all' + | 'removals' + | 'removals additions' + | 'removals text' + | 'text' + | 'text additions' + | 'text removals' + | undefined; + /** Indicates that user input is required on the element before a form may be submitted. */ + 'aria-required'?: boolean | 'false' | 'true' | undefined; + /** Defines a human-readable, author-localized description for the role of an element. */ + 'aria-roledescription'?: string | undefined; + /** + * Defines the total number of rows in a table, grid, or treegrid. + * @see aria-rowindex. + */ + 'aria-rowcount'?: number | undefined; + /** + * Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid. + * @see aria-rowcount @see aria-rowspan. + */ + 'aria-rowindex'?: number | undefined; + /** + * Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid. + * @see aria-rowindex @see aria-colspan. + */ + 'aria-rowspan'?: number | undefined; + /** + * Indicates the current "selected" state of various widgets. + * @see aria-checked @see aria-pressed. + */ + 'aria-selected'?: boolean | 'false' | 'true' | undefined; + /** + * Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM. + * @see aria-posinset. + */ + 'aria-setsize'?: number | undefined; + /** Indicates if items in a table or grid are sorted in ascending or descending order. */ + 'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other' | undefined; + /** Defines the maximum allowed value for a range widget. */ + 'aria-valuemax'?: number | undefined; + /** Defines the minimum allowed value for a range widget. */ + 'aria-valuemin'?: number | undefined; + /** + * Defines the current value for a range widget. + * @see aria-valuetext. + */ + 'aria-valuenow'?: number | undefined; + /** Defines the human readable text alternative of aria-valuenow for a range widget. */ + 'aria-valuetext'?: string | undefined; +} +export type Booleanish = boolean | 'true' | 'false'; +export type AriaRole = + | 'alert' + | 'alertdialog' + | 'application' + | 'article' + | 'banner' + | 'button' + | 'cell' + | 'checkbox' + | 'columnheader' + | 'combobox' + | 'complementary' + | 'contentinfo' + | 'definition' + | 'dialog' + | 'directory' + | 'document' + | 'feed' + | 'figure' + | 'form' + | 'grid' + | 'gridcell' + | 'group' + | 'heading' + | 'img' + | 'link' + | 'list' + | 'listbox' + | 'listitem' + | 'log' + | 'main' + | 'marquee' + | 'math' + | 'menu' + | 'menubar' + | 'menuitem' + | 'menuitemcheckbox' + | 'menuitemradio' + | 'navigation' + | 'none' + | 'note' + | 'option' + | 'presentation' + | 'progressbar' + | 'radio' + | 'radiogroup' + | 'region' + | 'row' + | 'rowgroup' + | 'rowheader' + | 'scrollbar' + | 'search' + | 'searchbox' + | 'separator' + | 'slider' + | 'spinbutton' + | 'status' + | 'switch' + | 'tab' + | 'table' + | 'tablist' + | 'tabpanel' + | 'term' + | 'textbox' + | 'timer' + | 'toolbar' + | 'tooltip' + | 'tree' + | 'treegrid' + | 'treeitem' + | (string & {}); +export interface HTMLAttributes extends AriaAttributes, DOMAttributes { + accessKey?: string | undefined; + className?: string | undefined; + contentEditable?: Booleanish | 'inherit' | undefined; + contextMenu?: string | undefined; + dir?: string | undefined; + draggable?: Booleanish | undefined; + hidden?: boolean | undefined; + id?: string | undefined; + lang?: string | undefined; + placeholder?: string | undefined; + slot?: string | undefined; + spellCheck?: Booleanish | undefined; + style?: CSSProperties | undefined; + tabIndex?: number | undefined; + title?: string | undefined; + translate?: 'yes' | 'no' | undefined; + + radioGroup?: string | undefined; // , + + role?: AriaRole | undefined; + + about?: string | undefined; + datatype?: string | undefined; + inlist?: any; + prefix?: string | undefined; + property?: string | undefined; + resource?: string | undefined; + typeof?: string | undefined; + vocab?: string | undefined; + + autoCapitalize?: string | undefined; + autoCorrect?: string | undefined; + autoSave?: string | undefined; + color?: string | undefined; + itemProp?: string | undefined; + itemScope?: boolean | undefined; + itemType?: string | undefined; + itemID?: string | undefined; + itemRef?: string | undefined; + results?: number | undefined; + security?: string | undefined; + unselectable?: 'on' | 'off' | undefined; + + /** + * Hints at the type of data that might be entered by the user while editing the element or its contents + * @see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute + */ + inputMode?: + | 'none' + | 'text' + | 'tel' + | 'url' + | 'email' + | 'numeric' + | 'decimal' + | 'search' + | undefined; + /** + * Specify that a standard HTML element should behave like a defined custom built-in element + * @see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is + */ + is?: string | undefined; +} +export type HTMLAttributeAnchorTarget = '_self' | '_blank' | '_parent' | '_top' | (string & {}); +export type HTMLAttributeReferrerPolicy = + | '' + | 'no-referrer' + | 'no-referrer-when-downgrade' + | 'origin' + | 'origin-when-cross-origin' + | 'same-origin' + | 'strict-origin' + | 'strict-origin-when-cross-origin' + | 'unsafe-url'; +export interface AnchorHTMLAttributes extends HTMLAttributes { + download?: any; + href?: string | undefined; + hrefLang?: string | undefined; + media?: string | undefined; + ping?: string | undefined; + rel?: string | undefined; + target?: HTMLAttributeAnchorTarget | undefined; + type?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; +} +export interface AreaHTMLAttributes extends HTMLAttributes { + alt?: string | undefined; + coords?: string | undefined; + download?: any; + href?: string | undefined; + hrefLang?: string | undefined; + media?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + rel?: string | undefined; + shape?: string | undefined; + target?: string | undefined; +} +export interface MediaHTMLAttributes extends HTMLAttributes { + autoPlay?: boolean | undefined; + controls?: boolean | undefined; + controlsList?: string | undefined; + crossOrigin?: string | undefined; + loop?: boolean | undefined; + mediaGroup?: string | undefined; + muted?: boolean | undefined; + playsInline?: boolean | undefined; + preload?: string | undefined; + src?: string | undefined; +} +export interface AudioHTMLAttributes extends MediaHTMLAttributes {} +export interface BaseHTMLAttributes extends HTMLAttributes { + href?: string | undefined; + target?: string | undefined; +} +export interface BlockquoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; +} +export interface ButtonHTMLAttributes extends HTMLAttributes { + autoFocus?: boolean | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + formAction?: string | undefined; + formEncType?: string | undefined; + formMethod?: string | undefined; + formNoValidate?: boolean | undefined; + formTarget?: string | undefined; + name?: string | undefined; + type?: 'submit' | 'reset' | 'button' | undefined; + value?: string | ReadonlyArray | number | undefined; +} +export interface CanvasHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + width?: number | string | undefined; +} +export interface ColHTMLAttributes extends HTMLAttributes { + span?: number | undefined; + width?: number | string | undefined; +} +export interface ColgroupHTMLAttributes extends HTMLAttributes { + span?: number | undefined; +} +export interface DataHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined; +} +export interface DelHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + dateTime?: string | undefined; +} + +export interface DetailsHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined; +} +export interface DialogHTMLAttributes extends HTMLAttributes { + open?: boolean | undefined; +} +export interface EmbedHTMLAttributes extends HTMLAttributes { + height?: number | string | undefined; + src?: string | undefined; + type?: string | undefined; + width?: number | string | undefined; +} +export interface FieldsetHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + form?: string | undefined; + name?: string | undefined; +} +export interface FormHTMLAttributes extends HTMLAttributes { + acceptCharset?: string | undefined; + action?: string | undefined; + autoComplete?: string | undefined; + encType?: string | undefined; + method?: string | undefined; + name?: string | undefined; + noValidate?: boolean | undefined; + target?: string | undefined; +} +export interface HtmlHTMLAttributes extends HTMLAttributes { + manifest?: string | undefined; +} +export interface IframeHTMLAttributes extends HTMLAttributes { + allow?: string | undefined; + allowFullScreen?: boolean | undefined; + allowTransparency?: boolean | undefined; + /** @deprecated Deprecated */ + frameBorder?: number | string | undefined; + height?: number | string | undefined; + loading?: 'eager' | 'lazy' | undefined; + /** @deprecated Deprecated */ + marginHeight?: number | undefined; + /** @deprecated Deprecated */ + marginWidth?: number | undefined; + name?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + sandbox?: string | undefined; + /** @deprecated Deprecated */ + scrolling?: string | undefined; + seamless?: boolean | undefined; + src?: string | undefined; + srcDoc?: string | undefined; + width?: number | string | undefined; +} +export interface ImgHTMLAttributes extends HTMLAttributes { + alt?: string | undefined; + crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined; + decoding?: 'async' | 'auto' | 'sync' | undefined; + height?: number | string | undefined; + loading?: 'eager' | 'lazy' | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + sizes?: string | undefined; + src?: string | undefined; + srcSet?: string | undefined; + useMap?: string | undefined; + width?: number | string | undefined; +} + +export interface InputHTMLAttributes extends HTMLAttributes { + accept?: string | undefined; + alt?: string | undefined; + autoComplete?: string | undefined; + autoFocus?: boolean | undefined; + capture?: boolean | string | undefined; // https://www.w3.org/TR/html-media-capture/#the-capture-attribute + checked?: boolean | undefined; + crossOrigin?: string | undefined; + disabled?: boolean | undefined; + enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send' | undefined; + form?: string | undefined; + formAction?: string | undefined; + formEncType?: string | undefined; + formMethod?: string | undefined; + formNoValidate?: boolean | undefined; + formTarget?: string | undefined; + height?: number | string | undefined; + list?: string | undefined; + max?: number | string | undefined; + maxLength?: number | undefined; + min?: number | string | undefined; + minLength?: number | undefined; + multiple?: boolean | undefined; + name?: string | undefined; + pattern?: string | undefined; + placeholder?: string | undefined; + readOnly?: boolean | undefined; + required?: boolean | undefined; + size?: number | undefined; + src?: string | undefined; + step?: number | string | undefined; + type?: string | undefined; + value?: string | ReadonlyArray | number | undefined; + width?: number | string | undefined; +} +export interface InsHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; + dateTime?: string | undefined; +} +export interface KeygenHTMLAttributes extends HTMLAttributes { + autoFocus?: boolean | undefined; + challenge?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + keyType?: string | undefined; + keyParams?: string | undefined; + name?: string | undefined; +} +export interface LabelHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + htmlFor?: string | undefined; +} +export interface LiHTMLAttributes extends HTMLAttributes { + value?: string | ReadonlyArray | number | undefined; +} +export interface LinkHTMLAttributes extends HTMLAttributes { + as?: string | undefined; + crossOrigin?: string | undefined; + href?: string | undefined; + hrefLang?: string | undefined; + integrity?: string | undefined; + media?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + rel?: string | undefined; + sizes?: string | undefined; + type?: string | undefined; + charSet?: string | undefined; +} +export interface MapHTMLAttributes extends HTMLAttributes { + name?: string | undefined; +} +export interface MenuHTMLAttributes extends HTMLAttributes { + type?: string | undefined; +} +export interface MetaHTMLAttributes extends HTMLAttributes { + charSet?: string | undefined; + content?: string | undefined; + httpEquiv?: string | undefined; + name?: string | undefined; +} +export interface MeterHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + high?: number | undefined; + low?: number | undefined; + max?: number | string | undefined; + min?: number | string | undefined; + optimum?: number | undefined; + value?: string | ReadonlyArray | number | undefined; +} +export interface ObjectHTMLAttributes extends HTMLAttributes { + classID?: string | undefined; + data?: string | undefined; + form?: string | undefined; + height?: number | string | undefined; + name?: string | undefined; + type?: string | undefined; + useMap?: string | undefined; + width?: number | string | undefined; + wmode?: string | undefined; +} +export interface OlHTMLAttributes extends HTMLAttributes { + reversed?: boolean | undefined; + start?: number | undefined; + type?: '1' | 'a' | 'A' | 'i' | 'I' | undefined; +} +export interface OptgroupHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + label?: string | undefined; +} +export interface OptionHTMLAttributes extends HTMLAttributes { + disabled?: boolean | undefined; + label?: string | undefined; + selected?: boolean | undefined; + value?: string | ReadonlyArray | number | undefined; +} +export interface OutputHTMLAttributes extends HTMLAttributes { + form?: string | undefined; + htmlFor?: string | undefined; + name?: string | undefined; +} +export interface ParamHTMLAttributes extends HTMLAttributes { + name?: string | undefined; + value?: string | ReadonlyArray | number | undefined; +} +export interface ProgressHTMLAttributes extends HTMLAttributes { + max?: number | string | undefined; + value?: string | ReadonlyArray | number | undefined; +} +export interface QuoteHTMLAttributes extends HTMLAttributes { + cite?: string | undefined; +} +export interface SlotHTMLAttributes extends HTMLAttributes { + name?: string | undefined; +} +export interface ScriptHTMLAttributes extends HTMLAttributes { + async?: boolean | undefined; + /** @deprecated Deprecated */ + charSet?: string | undefined; + crossOrigin?: string | undefined; + defer?: boolean | undefined; + integrity?: string | undefined; + noModule?: boolean | undefined; + nonce?: string | undefined; + referrerPolicy?: HTMLAttributeReferrerPolicy | undefined; + src?: string | undefined; + type?: string | undefined; +} +export interface SelectHTMLAttributes extends HTMLAttributes { + autoComplete?: string | undefined; + autoFocus?: boolean | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + multiple?: boolean | undefined; + name?: string | undefined; + required?: boolean | undefined; + size?: number | undefined; + value?: string | ReadonlyArray | number | undefined; +} +export interface SourceHTMLAttributes extends HTMLAttributes { + media?: string | undefined; + sizes?: string | undefined; + src?: string | undefined; + srcSet?: string | undefined; + type?: string | undefined; +} +export interface StyleHTMLAttributes extends HTMLAttributes { + media?: string | undefined; + nonce?: string | undefined; + scoped?: boolean | undefined; + type?: string | undefined; +} +export interface TableHTMLAttributes extends HTMLAttributes { + cellPadding?: number | string | undefined; + cellSpacing?: number | string | undefined; + summary?: string | undefined; + width?: number | string | undefined; +} +export interface TdHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; + colSpan?: number | undefined; + headers?: string | undefined; + rowSpan?: number | undefined; + scope?: string | undefined; + abbr?: string | undefined; + height?: number | string | undefined; + width?: number | string | undefined; + valign?: 'top' | 'middle' | 'bottom' | 'baseline' | undefined; +} +export interface TextareaHTMLAttributes extends HTMLAttributes { + autoComplete?: string | undefined; + autoFocus?: boolean | undefined; + cols?: number | undefined; + dirName?: string | undefined; + disabled?: boolean | undefined; + form?: string | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + name?: string | undefined; + placeholder?: string | undefined; + readOnly?: boolean | undefined; + required?: boolean | undefined; + rows?: number | undefined; + value?: string | ReadonlyArray | number | undefined; + wrap?: string | undefined; +} +export interface ThHTMLAttributes extends HTMLAttributes { + align?: 'left' | 'center' | 'right' | 'justify' | 'char' | undefined; + colSpan?: number | undefined; + headers?: string | undefined; + rowSpan?: number | undefined; + scope?: string | undefined; + abbr?: string | undefined; +} +export interface TimeHTMLAttributes extends HTMLAttributes { + dateTime?: string | undefined; +} +export interface TrackHTMLAttributes extends HTMLAttributes { + default?: boolean | undefined; + kind?: string | undefined; + label?: string | undefined; + src?: string | undefined; + srcLang?: string | undefined; +} +export interface VideoHTMLAttributes extends MediaHTMLAttributes { + height?: number | string | undefined; + playsInline?: boolean | undefined; + poster?: string | undefined; + width?: number | string | undefined; + disablePictureInPicture?: boolean | undefined; + disableRemotePlayback?: boolean | undefined; +} +export interface WebViewHTMLAttributes extends HTMLAttributes { + allowFullScreen?: boolean | undefined; + allowpopups?: boolean | undefined; + autoFocus?: boolean | undefined; + autosize?: boolean | undefined; + blinkfeatures?: string | undefined; + disableblinkfeatures?: string | undefined; + disableguestresize?: boolean | undefined; + disablewebsecurity?: boolean | undefined; + guestinstance?: string | undefined; + httpreferrer?: string | undefined; + nodeintegration?: boolean | undefined; + partition?: string | undefined; + plugins?: boolean | undefined; + preload?: string | undefined; + src?: string | undefined; + useragent?: string | undefined; + webpreferences?: string | undefined; +} +export interface SVGAttributes extends AriaAttributes, DOMAttributes { + className?: string | undefined; + color?: string | undefined; + height?: number | string | undefined; + id?: string | undefined; + lang?: string | undefined; + max?: number | string | undefined; + media?: string | undefined; + method?: string | undefined; + min?: number | string | undefined; + name?: string | undefined; + style?: CSSProperties | undefined; + target?: string | undefined; + type?: string | undefined; + width?: number | string | undefined; + + role?: AriaRole | undefined; + tabIndex?: number | undefined; + crossOrigin?: 'anonymous' | 'use-credentials' | '' | undefined; + + accentHeight?: number | string | undefined; + accumulate?: 'none' | 'sum' | undefined; + additive?: 'replace' | 'sum' | undefined; + alignmentBaseline?: + | 'auto' + | 'baseline' + | 'before-edge' + | 'text-before-edge' + | 'middle' + | 'central' + | 'after-edge' + | 'text-after-edge' + | 'ideographic' + | 'alphabetic' + | 'hanging' + | 'mathematical' + | 'inherit' + | undefined; + allowReorder?: 'no' | 'yes' | undefined; + alphabetic?: number | string | undefined; + amplitude?: number | string | undefined; + arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated' | undefined; + ascent?: number | string | undefined; + attributeName?: string | undefined; + attributeType?: string | undefined; + autoReverse?: Booleanish | undefined; + azimuth?: number | string | undefined; + baseFrequency?: number | string | undefined; + baselineShift?: number | string | undefined; + baseProfile?: number | string | undefined; + bbox?: number | string | undefined; + begin?: number | string | undefined; + bias?: number | string | undefined; + by?: number | string | undefined; + calcMode?: number | string | undefined; + capHeight?: number | string | undefined; + clip?: number | string | undefined; + clipPath?: string | undefined; + clipPathUnits?: number | string | undefined; + clipRule?: number | string | undefined; + colorInterpolation?: number | string | undefined; + colorInterpolationFilters?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit' | undefined; + colorProfile?: number | string | undefined; + colorRendering?: number | string | undefined; + contentScriptType?: number | string | undefined; + contentStyleType?: number | string | undefined; + cursor?: number | string | undefined; + cx?: number | string | undefined; + cy?: number | string | undefined; + d?: string | undefined; + decelerate?: number | string | undefined; + descent?: number | string | undefined; + diffuseConstant?: number | string | undefined; + direction?: number | string | undefined; + display?: number | string | undefined; + divisor?: number | string | undefined; + dominantBaseline?: number | string | undefined; + dur?: number | string | undefined; + dx?: number | string | undefined; + dy?: number | string | undefined; + edgeMode?: number | string | undefined; + elevation?: number | string | undefined; + enableBackground?: number | string | undefined; + end?: number | string | undefined; + exponent?: number | string | undefined; + externalResourcesRequired?: Booleanish | undefined; + fill?: string | undefined; + fillOpacity?: number | string | undefined; + fillRule?: 'nonzero' | 'evenodd' | 'inherit' | undefined; + filter?: string | undefined; + filterRes?: number | string | undefined; + filterUnits?: number | string | undefined; + floodColor?: number | string | undefined; + floodOpacity?: number | string | undefined; + focusable?: Booleanish | 'auto' | undefined; + fontFamily?: string | undefined; + fontSize?: number | string | undefined; + fontSizeAdjust?: number | string | undefined; + fontStretch?: number | string | undefined; + fontStyle?: number | string | undefined; + fontVariant?: number | string | undefined; + fontWeight?: number | string | undefined; + format?: number | string | undefined; + from?: number | string | undefined; + fx?: number | string | undefined; + fy?: number | string | undefined; + g1?: number | string | undefined; + g2?: number | string | undefined; + glyphName?: number | string | undefined; + glyphOrientationHorizontal?: number | string | undefined; + glyphOrientationVertical?: number | string | undefined; + glyphRef?: number | string | undefined; + gradientTransform?: string | undefined; + gradientUnits?: string | undefined; + hanging?: number | string | undefined; + horizAdvX?: number | string | undefined; + horizOriginX?: number | string | undefined; + href?: string | undefined; + ideographic?: number | string | undefined; + imageRendering?: number | string | undefined; + in2?: number | string | undefined; + in?: string | undefined; + intercept?: number | string | undefined; + k1?: number | string | undefined; + k2?: number | string | undefined; + k3?: number | string | undefined; + k4?: number | string | undefined; + k?: number | string | undefined; + kernelMatrix?: number | string | undefined; + kernelUnitLength?: number | string | undefined; + kerning?: number | string | undefined; + keyPoints?: number | string | undefined; + keySplines?: number | string | undefined; + keyTimes?: number | string | undefined; + lengthAdjust?: number | string | undefined; + letterSpacing?: number | string | undefined; + lightingColor?: number | string | undefined; + limitingConeAngle?: number | string | undefined; + local?: number | string | undefined; + markerEnd?: string | undefined; + markerHeight?: number | string | undefined; + markerMid?: string | undefined; + markerStart?: string | undefined; + markerUnits?: number | string | undefined; + markerWidth?: number | string | undefined; + mask?: string | undefined; + maskContentUnits?: number | string | undefined; + maskUnits?: number | string | undefined; + mathematical?: number | string | undefined; + mode?: number | string | undefined; + numOctaves?: number | string | undefined; + offset?: number | string | undefined; + opacity?: number | string | undefined; + operator?: number | string | undefined; + order?: number | string | undefined; + orient?: number | string | undefined; + orientation?: number | string | undefined; + origin?: number | string | undefined; + overflow?: number | string | undefined; + overlinePosition?: number | string | undefined; + overlineThickness?: number | string | undefined; + paintOrder?: number | string | undefined; + panose1?: number | string | undefined; + path?: string | undefined; + pathLength?: number | string | undefined; + patternContentUnits?: string | undefined; + patternTransform?: number | string | undefined; + patternUnits?: string | undefined; + pointerEvents?: number | string | undefined; + points?: string | undefined; + pointsAtX?: number | string | undefined; + pointsAtY?: number | string | undefined; + pointsAtZ?: number | string | undefined; + preserveAlpha?: Booleanish | undefined; + preserveAspectRatio?: string | undefined; + primitiveUnits?: number | string | undefined; + r?: number | string | undefined; + radius?: number | string | undefined; + refX?: number | string | undefined; + refY?: number | string | undefined; + renderingIntent?: number | string | undefined; + repeatCount?: number | string | undefined; + repeatDur?: number | string | undefined; + requiredExtensions?: number | string | undefined; + requiredFeatures?: number | string | undefined; + restart?: number | string | undefined; + result?: string | undefined; + rotate?: number | string | undefined; + rx?: number | string | undefined; + ry?: number | string | undefined; + scale?: number | string | undefined; + seed?: number | string | undefined; + shapeRendering?: number | string | undefined; + slope?: number | string | undefined; + spacing?: number | string | undefined; + specularConstant?: number | string | undefined; + specularExponent?: number | string | undefined; + speed?: number | string | undefined; + spreadMethod?: string | undefined; + startOffset?: number | string | undefined; + stdDeviation?: number | string | undefined; + stemh?: number | string | undefined; + stemv?: number | string | undefined; + stitchTiles?: number | string | undefined; + stopColor?: string | undefined; + stopOpacity?: number | string | undefined; + strikethroughPosition?: number | string | undefined; + strikethroughThickness?: number | string | undefined; + string?: number | string | undefined; + stroke?: string | undefined; + strokeDasharray?: string | number | undefined; + strokeDashoffset?: string | number | undefined; + strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit' | undefined; + strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined; + strokeMiterlimit?: number | string | undefined; + strokeOpacity?: number | string | undefined; + strokeWidth?: number | string | undefined; + surfaceScale?: number | string | undefined; + systemLanguage?: number | string | undefined; + tableValues?: number | string | undefined; + targetX?: number | string | undefined; + targetY?: number | string | undefined; + textAnchor?: string | undefined; + textDecoration?: number | string | undefined; + textLength?: number | string | undefined; + textRendering?: number | string | undefined; + to?: number | string | undefined; + transform?: string | undefined; + u1?: number | string | undefined; + u2?: number | string | undefined; + underlinePosition?: number | string | undefined; + underlineThickness?: number | string | undefined; + unicode?: number | string | undefined; + unicodeBidi?: number | string | undefined; + unicodeRange?: number | string | undefined; + unitsPerEm?: number | string | undefined; + vAlphabetic?: number | string | undefined; + values?: string | undefined; + vectorEffect?: number | string | undefined; + version?: string | undefined; + vertAdvY?: number | string | undefined; + vertOriginX?: number | string | undefined; + vertOriginY?: number | string | undefined; + vHanging?: number | string | undefined; + vIdeographic?: number | string | undefined; + viewBox?: string | undefined; + viewTarget?: number | string | undefined; + visibility?: number | string | undefined; + vMathematical?: number | string | undefined; + widths?: number | string | undefined; + wordSpacing?: number | string | undefined; + writingMode?: number | string | undefined; + x1?: number | string | undefined; + x2?: number | string | undefined; + x?: number | string | undefined; + xChannelSelector?: string | undefined; + xHeight?: number | string | undefined; + xlinkActuate?: string | undefined; + xlinkArcrole?: string | undefined; + xlinkHref?: string | undefined; + xlinkRole?: string | undefined; + xlinkShow?: string | undefined; + xlinkTitle?: string | undefined; + xlinkType?: string | undefined; + xmlBase?: string | undefined; + xmlLang?: string | undefined; + xmlns?: string | undefined; + xmlnsXlink?: string | undefined; + xmlSpace?: string | undefined; + y1?: number | string | undefined; + y2?: number | string | undefined; + y?: number | string | undefined; + yChannelSelector?: string | undefined; + z?: number | string | undefined; + zoomAndPan?: string | undefined; +} +export interface SVGProps extends SVGAttributes, ClassAttributes {} +export interface IntrinsicElements { + a: AnchorHTMLAttributes; + abbr: HTMLAttributes; + address: HTMLAttributes; + area: AreaHTMLAttributes; + article: HTMLAttributes; + aside: HTMLAttributes; + audio: AudioHTMLAttributes; + b: HTMLAttributes; + base: BaseHTMLAttributes; + bdi: HTMLAttributes; + bdo: HTMLAttributes; + big: HTMLAttributes; + blockquote: BlockquoteHTMLAttributes; + body: HTMLAttributes; + br: HTMLAttributes; + button: ButtonHTMLAttributes; + canvas: CanvasHTMLAttributes; + caption: HTMLAttributes; + cite: HTMLAttributes; + code: HTMLAttributes; + col: ColHTMLAttributes; + colgroup: ColgroupHTMLAttributes; + data: DataHTMLAttributes; + datalist: HTMLAttributes; + dd: HTMLAttributes; + del: DelHTMLAttributes; + details: DetailsHTMLAttributes; + dfn: HTMLAttributes; + dialog: DialogHTMLAttributes; + div: HTMLAttributes; + dl: HTMLAttributes; + dt: HTMLAttributes; + em: HTMLAttributes; + embed: EmbedHTMLAttributes; + fieldset: FieldsetHTMLAttributes; + figcaption: HTMLAttributes; + figure: HTMLAttributes; + footer: HTMLAttributes; + form: FormHTMLAttributes; + h1: HTMLAttributes; + h2: HTMLAttributes; + h3: HTMLAttributes; + h4: HTMLAttributes; + h5: HTMLAttributes; + h6: HTMLAttributes; + head: HTMLAttributes; + header: HTMLAttributes; + hgroup: HTMLAttributes; + hr: HTMLAttributes; + html: HtmlHTMLAttributes; + i: HTMLAttributes; + iframe: IframeHTMLAttributes; + img: ImgHTMLAttributes; + input: InputHTMLAttributes; + ins: InsHTMLAttributes; + kbd: HTMLAttributes; + keygen: KeygenHTMLAttributes; + label: LabelHTMLAttributes; + legend: HTMLAttributes; + li: LiHTMLAttributes; + link: LinkHTMLAttributes; + main: HTMLAttributes; + map: MapHTMLAttributes; + mark: HTMLAttributes; + menu: MenuHTMLAttributes; + menuitem: HTMLAttributes; + meta: MetaHTMLAttributes; + meter: MeterHTMLAttributes; + nav: HTMLAttributes; + noindex: HTMLAttributes; + noscript: HTMLAttributes; + object: ObjectHTMLAttributes; + ol: OlHTMLAttributes; + optgroup: OptgroupHTMLAttributes; + option: OptionHTMLAttributes; + output: OutputHTMLAttributes; + p: HTMLAttributes; + param: ParamHTMLAttributes; + picture: HTMLAttributes; + pre: HTMLAttributes; + progress: ProgressHTMLAttributes; + q: QuoteHTMLAttributes; + rp: HTMLAttributes; + rt: HTMLAttributes; + ruby: HTMLAttributes; + s: HTMLAttributes; + samp: HTMLAttributes; + slot: SlotHTMLAttributes; + script: ScriptHTMLAttributes; + section: HTMLAttributes; + select: SelectHTMLAttributes; + small: HTMLAttributes; + source: SourceHTMLAttributes; + span: HTMLAttributes; + strong: HTMLAttributes; + style: StyleHTMLAttributes; + sub: HTMLAttributes; + summary: HTMLAttributes; + sup: HTMLAttributes; + table: TableHTMLAttributes; + template: HTMLAttributes; + tbody: HTMLAttributes; + td: TdHTMLAttributes; + textarea: TextareaHTMLAttributes; + tfoot: HTMLAttributes; + th: ThHTMLAttributes; + thead: HTMLAttributes; + time: TimeHTMLAttributes; + title: HTMLAttributes; + tr: HTMLAttributes; + track: TrackHTMLAttributes; + u: HTMLAttributes; + ul: HTMLAttributes; + video: VideoHTMLAttributes; + wbr: HTMLAttributes; + webview: WebViewHTMLAttributes; + svg: SVGProps; + animate: SVGProps; + animateMotion: SVGProps; + animateTransform: SVGProps; + circle: SVGProps; + clipPath: SVGProps; + defs: SVGProps; + desc: SVGProps; + ellipse: SVGProps; + feBlend: SVGProps; + feColorMatrix: SVGProps; + feComponentTransfer: SVGProps; + feComposite: SVGProps; + feConvolveMatrix: SVGProps; + feDiffuseLighting: SVGProps; + feDisplacementMap: SVGProps; + feDistantLight: SVGProps; + feDropShadow: SVGProps; + feFlood: SVGProps; + feFuncA: SVGProps; + feFuncB: SVGProps; + feFuncG: SVGProps; + feFuncR: SVGProps; + feGaussianBlur: SVGProps; + feImage: SVGProps; + feMerge: SVGProps; + feMergeNode: SVGProps; + feMorphology: SVGProps; + feOffset: SVGProps; + fePointLight: SVGProps; + feSpecularLighting: SVGProps; + feSpotLight: SVGProps; + feTile: SVGProps; + feTurbulence: SVGProps; + filter: SVGProps; + foreignObject: SVGProps; + g: SVGProps; + image: SVGProps; + line: SVGProps; + linearGradient: SVGProps; + marker: SVGProps; + mask: SVGProps; + metadata: SVGProps; + mpath: SVGProps; + path: SVGProps; + pattern: SVGProps; + polygon: SVGProps; + polyline: SVGProps; + radialGradient: SVGProps; + rect: SVGProps; + stop: SVGProps; + switch: SVGProps; + symbol: SVGProps; + text: SVGProps; + textPath: SVGProps; + tspan: SVGProps; + use: SVGProps; + view: SVGProps; +} diff --git a/src/core/render/jsx/types/jsx_node.ts b/src/core/render/jsx/types/jsx-node.ts similarity index 100% rename from src/core/render/jsx/types/jsx_node.ts rename to src/core/render/jsx/types/jsx-node.ts diff --git a/src/core/render/jsx/types/jsx_dom_events.ts b/src/core/render/jsx/types/jsx-qwik-attributes.ts similarity index 74% rename from src/core/render/jsx/types/jsx_dom_events.ts rename to src/core/render/jsx/types/jsx-qwik-attributes.ts index 0d26d9976a3..f47ea8e458d 100644 --- a/src/core/render/jsx/types/jsx_dom_events.ts +++ b/src/core/render/jsx/types/jsx-qwik-attributes.ts @@ -1,6 +1,39 @@ -import type { QRL } from '../../../import/qrl'; +/* eslint-disable */ +import type { EntityConstructor, QRL } from '../../..'; -export interface JSXDOMEvents { +interface QwikProps { + class?: string | { [className: string]: boolean }; + innerHTML?: string; + /** + * Declare `Injector` `Entity` providers. + * + * See: `Injector`, `Entity` + */ + 'decl:entity'?: EntityConstructor[]; + + /** + * Declare component template. + */ + 'decl:template'?: QRL; +} + +interface QwikGlobalEvents { + /** + * Event fired when DOM is first loaded + */ + 'on:qInit'?: QRL; + + // TODO: document + 'on:qInterval'?: QRL; + + // TODO: document + 'on:qTimeout'?: QRL; + + // TODO: document + 'on:qRender'?: QRL; +} + +interface QwikDOMEvents { 'on:abort'?: QRL; 'on:animationend'?: QRL; 'on:animationiteration'?: QRL; @@ -91,3 +124,8 @@ export interface JSXDOMEvents { 'on:webkittransitionend'?: QRL; 'on:wheel'?: QRL; } + +/** + * @internal + */ +export interface DOMAttributes extends QwikProps, QwikGlobalEvents, QwikDOMEvents {} diff --git a/src/core/render/jsx/types/jsx-qwik-elements.ts b/src/core/render/jsx/types/jsx-qwik-elements.ts new file mode 100644 index 00000000000..a74d3660217 --- /dev/null +++ b/src/core/render/jsx/types/jsx-qwik-elements.ts @@ -0,0 +1,19 @@ +import type { HTMLAttributes, IntrinsicElements, ScriptHTMLAttributes } from './jsx-generated'; + +interface QwikScriptHTMLAttributes extends ScriptHTMLAttributes { + events?: string[]; +} + +interface QwikCustomHTMLAttributes extends HTMLAttributes { + [key: string]: any; +} + +interface QwikCustomHTMLElement extends HTMLElement {} + +/** + * @public + */ +export interface QwikIntrinsicElements extends IntrinsicElements { + script: QwikScriptHTMLAttributes; + [key: string]: QwikCustomHTMLAttributes; +} diff --git a/src/core/render/jsx/types/jsx-qwik.ts b/src/core/render/jsx/types/jsx-qwik.ts new file mode 100644 index 00000000000..99e88687b0f --- /dev/null +++ b/src/core/render/jsx/types/jsx-qwik.ts @@ -0,0 +1,16 @@ +import type { DOMAttributes } from './jsx-qwik-attributes'; +import type { JSXNode } from './jsx-node'; +import type { QwikIntrinsicElements } from './jsx-qwik-elements'; + +/** + * @public + */ +export namespace QwikJSX { + export interface Element extends JSXNode {} + export interface IntrinsicAttributes { + [key: string]: any; + } + export interface IntrinsicElements extends QwikIntrinsicElements {} +} + +export interface QwikDOMAttributes extends DOMAttributes {} diff --git a/src/core/render/jsx/types/jsx.ts b/src/core/render/jsx/types/jsx.ts deleted file mode 100644 index ebac72d1dc3..00000000000 --- a/src/core/render/jsx/types/jsx.ts +++ /dev/null @@ -1,622 +0,0 @@ -/* eslint-disable */ -import type { JSXBase } from './jsx_base'; -import type { JSXDOMEvents } from './jsx_dom_events'; - -/** - * @internal - */ -export namespace JSXInternal { - export interface IntrinsicAttributes { - key?: any; - } - - export interface SVGAttributes - extends HTMLAttributes { - accentHeight?: number | string; - accumulate?: 'none' | 'sum'; - additive?: 'replace' | 'sum'; - alignmentBaseline?: - | 'auto' - | 'baseline' - | 'before-edge' - | 'text-before-edge' - | 'middle' - | 'central' - | 'after-edge' - | 'text-after-edge' - | 'ideographic' - | 'alphabetic' - | 'hanging' - | 'mathematical' - | 'inherit'; - allowReorder?: 'no' | 'yes'; - alphabetic?: number | string; - amplitude?: number | string; - arabicForm?: 'initial' | 'medial' | 'terminal' | 'isolated'; - ascent?: number | string; - attributeName?: string; - attributeType?: string; - autoReverse?: number | string; - azimuth?: number | string; - baseFrequency?: number | string; - baselineShift?: number | string; - baseProfile?: number | string; - bbox?: number | string; - begin?: number | string; - bias?: number | string; - by?: number | string; - calcMode?: number | string; - capHeight?: number | string; - clip?: number | string; - clipPath?: string; - clipPathUnits?: number | string; - clipRule?: number | string; - colorInterpolation?: number | string; - colorInterpolationFilters?: 'auto' | 'sRGB' | 'linearRGB' | 'inherit'; - colorProfile?: number | string; - colorRendering?: number | string; - contentScriptType?: number | string; - contentStyleType?: number | string; - cursor?: number | string; - cx?: number | string; - cy?: number | string; - d?: string; - decelerate?: number | string; - descent?: number | string; - diffuseConstant?: number | string; - direction?: number | string; - display?: number | string; - divisor?: number | string; - dominantBaseline?: number | string; - dur?: number | string; - dx?: number | string; - dy?: number | string; - edgeMode?: number | string; - elevation?: number | string; - enableBackground?: number | string; - end?: number | string; - exponent?: number | string; - externalResourcesRequired?: number | string; - fill?: string; - fillOpacity?: number | string; - fillRule?: 'nonzero' | 'evenodd' | 'inherit'; - filter?: string; - filterRes?: number | string; - filterUnits?: number | string; - floodColor?: number | string; - floodOpacity?: number | string; - focusable?: number | string; - fontFamily?: string; - fontSize?: number | string; - fontSizeAdjust?: number | string; - fontStretch?: number | string; - fontStyle?: number | string; - fontVariant?: number | string; - fontWeight?: number | string; - format?: number | string; - from?: number | string; - fx?: number | string; - fy?: number | string; - g1?: number | string; - g2?: number | string; - glyphName?: number | string; - glyphOrientationHorizontal?: number | string; - glyphOrientationVertical?: number | string; - glyphRef?: number | string; - gradientTransform?: string; - gradientUnits?: string; - hanging?: number | string; - horizAdvX?: number | string; - horizOriginX?: number | string; - ideographic?: number | string; - imageRendering?: number | string; - in2?: number | string; - in?: string; - intercept?: number | string; - k1?: number | string; - k2?: number | string; - k3?: number | string; - k4?: number | string; - k?: number | string; - kernelMatrix?: number | string; - kernelUnitLength?: number | string; - kerning?: number | string; - keyPoints?: number | string; - keySplines?: number | string; - keyTimes?: number | string; - lengthAdjust?: number | string; - letterSpacing?: number | string; - lightingColor?: number | string; - limitingConeAngle?: number | string; - local?: number | string; - markerEnd?: string; - markerHeight?: number | string; - markerMid?: string; - markerStart?: string; - markerUnits?: number | string; - markerWidth?: number | string; - mask?: string; - maskContentUnits?: number | string; - maskUnits?: number | string; - mathematical?: number | string; - mode?: number | string; - numOctaves?: number | string; - offset?: number | string; - opacity?: number | string; - operator?: number | string; - order?: number | string; - orient?: number | string; - orientation?: number | string; - origin?: number | string; - overflow?: number | string; - overlinePosition?: number | string; - overlineThickness?: number | string; - paintOrder?: number | string; - panose1?: number | string; - pathLength?: number | string; - patternContentUnits?: string; - patternTransform?: number | string; - patternUnits?: string; - pointerEvents?: number | string; - points?: string; - pointsAtX?: number | string; - pointsAtY?: number | string; - pointsAtZ?: number | string; - preserveAlpha?: number | string; - preserveAspectRatio?: string; - primitiveUnits?: number | string; - r?: number | string; - radius?: number | string; - refX?: number | string; - refY?: number | string; - renderingIntent?: number | string; - repeatCount?: number | string; - repeatDur?: number | string; - requiredExtensions?: number | string; - requiredFeatures?: number | string; - restart?: number | string; - result?: string; - rotate?: number | string; - rx?: number | string; - ry?: number | string; - scale?: number | string; - seed?: number | string; - shapeRendering?: number | string; - slope?: number | string; - spacing?: number | string; - specularConstant?: number | string; - specularExponent?: number | string; - speed?: number | string; - spreadMethod?: string; - startOffset?: number | string; - stdDeviation?: number | string; - stemh?: number | string; - stemv?: number | string; - stitchTiles?: number | string; - stopColor?: string; - stopOpacity?: number | string; - strikethroughPosition?: number | string; - strikethroughThickness?: number | string; - string?: number | string; - stroke?: string; - strokeDasharray?: string | number; - strokeDashoffset?: string | number; - strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit'; - strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit'; - strokeMiterlimit?: string | number; - strokeOpacity?: number | string; - strokeWidth?: number | string; - surfaceScale?: number | string; - systemLanguage?: number | string; - tableValues?: number | string; - targetX?: number | string; - targetY?: number | string; - textAnchor?: string; - textDecoration?: number | string; - textLength?: number | string; - textRendering?: number | string; - to?: number | string; - transform?: string; - u1?: number | string; - u2?: number | string; - underlinePosition?: number | string; - underlineThickness?: number | string; - unicode?: number | string; - unicodeBidi?: number | string; - unicodeRange?: number | string; - unitsPerEm?: number | string; - vAlphabetic?: number | string; - values?: string; - vectorEffect?: number | string; - version?: string; - vertAdvY?: number | string; - vertOriginX?: number | string; - vertOriginY?: number | string; - vHanging?: number | string; - vIdeographic?: number | string; - viewBox?: string; - viewTarget?: number | string; - visibility?: number | string; - vMathematical?: number | string; - widths?: number | string; - wordSpacing?: number | string; - writingMode?: number | string; - x1?: number | string; - x2?: number | string; - x?: number | string; - xChannelSelector?: string; - xHeight?: number | string; - xlinkActuate?: string; - xlinkArcrole?: string; - xlinkHref?: string; - xlinkRole?: string; - xlinkShow?: string; - xlinkTitle?: string; - xlinkType?: string; - xmlBase?: string; - xmlLang?: string; - xmlns?: string; - xmlnsXlink?: string; - xmlSpace?: string; - y1?: number | string; - y2?: number | string; - y?: number | string; - yChannelSelector?: string; - z?: number | string; - zoomAndPan?: string; - } - - export interface PathAttributes { - d: string; - } - - export interface DOMAttributes - extends JSXDOMEvents, - JSXBase {} - - export interface HTMLAttributes - extends DOMAttributes { - // Standard HTML Attributes - accept?: string; - acceptCharset?: string; - accessKey?: string; - action?: string; - allowFullScreen?: boolean; - allowTransparency?: boolean; - alt?: string; - as?: string; - async?: boolean; - autocomplete?: string; - autoComplete?: string; - autocorrect?: string; - autoCorrect?: string; - autofocus?: boolean; - autoFocus?: boolean; - autoPlay?: boolean; - capture?: boolean | string; - cellPadding?: number | string; - cellSpacing?: number | string; - charSet?: string; - challenge?: string; - checked?: boolean; - class?: string | { [className: string]: boolean }; - className?: string; - cols?: number; - colSpan?: number; - content?: string; - contentEditable?: boolean; - contextMenu?: string; - controls?: boolean; - controlsList?: string; - coords?: string; - crossOrigin?: string; - data?: string; - dateTime?: string; - default?: boolean; - defer?: boolean; - dir?: 'auto' | 'rtl' | 'ltr'; - disabled?: boolean; - disableRemotePlayback?: boolean; - download?: any; - decoding?: 'sync' | 'async' | 'auto'; - draggable?: boolean; - encType?: string; - events?: string[]; - form?: string; - formAction?: string; - formEncType?: string; - formMethod?: string; - formNoValidate?: boolean; - formTarget?: string; - frameBorder?: number | string; - headers?: string; - height?: number | string; - hidden?: boolean; - high?: number; - href?: string; - hrefLang?: string; - for?: string; - htmlFor?: string; - httpEquiv?: string; - icon?: string; - id?: string; - innerHTML?: string; - innerText?: string; - inputMode?: string; - integrity?: string; - is?: string; - keyParams?: string; - keyType?: string; - kind?: string; - label?: string; - lang?: string; - list?: string; - loading?: 'eager' | 'lazy'; - loop?: boolean; - low?: number; - manifest?: string; - marginHeight?: number; - marginWidth?: number; - max?: number | string; - maxLength?: number; - media?: string; - mediaGroup?: string; - method?: string; - min?: number | string; - minLength?: number; - multiple?: boolean; - muted?: boolean; - name?: string; - nonce?: string; - noValidate?: boolean; - open?: boolean; - optimum?: number; - pattern?: string; - placeholder?: string; - playsInline?: boolean; - poster?: string; - preload?: string; - radioGroup?: string; - readonly?: boolean; - readOnly?: boolean; - rel?: string; - required?: boolean; - role?: string; - rows?: number; - rowSpan?: number; - sandbox?: string; - scope?: string; - scoped?: boolean; - scrolling?: string; - seamless?: boolean; - selected?: boolean; - shape?: string; - size?: number; - sizes?: string; - slot?: string; - span?: number; - spellcheck?: boolean; - src?: string; - srcset?: string; - srcDoc?: string; - srcLang?: string; - srcSet?: string; - start?: number; - step?: number | string; - style?: string; - summary?: string; - tabIndex?: number; - target?: string; - title?: string; - type?: string; - useMap?: string; - value?: string | string[] | number; - volume?: string | number; - width?: number | string; - wmode?: string; - wrap?: string; - - // RDFa Attributes - about?: string; - datatype?: string; - inlist?: any; - prefix?: string; - property?: string; - resource?: string; - typeof?: string; - vocab?: string; - - // Microdata Attributes - itemProp?: string; - itemScope?: boolean; - itemType?: string; - itemID?: string; - itemRef?: string; - } - - interface HTMLMarqueeElement extends HTMLElement { - behavior?: 'scroll' | 'slide' | 'alternate'; - bgColor?: string; - direction?: 'left' | 'right' | 'up' | 'down'; - height?: number | string; - hspace?: number | string; - loop?: number | string; - scrollAmount?: number | string; - scrollDelay?: number | string; - trueSpeed?: boolean; - vspace?: number | string; - width?: number | string; - } - - export interface IntrinsicElements { - // HTML - a: HTMLAttributes; - abbr: HTMLAttributes; - address: HTMLAttributes; - area: HTMLAttributes; - article: HTMLAttributes; - aside: HTMLAttributes; - audio: HTMLAttributes; - b: HTMLAttributes; - base: HTMLAttributes; - bdi: HTMLAttributes; - bdo: HTMLAttributes; - big: HTMLAttributes; - blockquote: HTMLAttributes; - body: HTMLAttributes; - br: HTMLAttributes; - button: HTMLAttributes; - canvas: HTMLAttributes; - caption: HTMLAttributes; - cite: HTMLAttributes; - code: HTMLAttributes; - col: HTMLAttributes; - colgroup: HTMLAttributes; - data: HTMLAttributes; - datalist: HTMLAttributes; - dd: HTMLAttributes; - del: HTMLAttributes; - details: HTMLAttributes; - dfn: HTMLAttributes; - dialog: HTMLAttributes; - div: HTMLAttributes; - dl: HTMLAttributes; - dt: HTMLAttributes; - em: HTMLAttributes; - embed: HTMLAttributes; - fieldset: HTMLAttributes; - figcaption: HTMLAttributes; - figure: HTMLAttributes; - footer: HTMLAttributes; - form: HTMLAttributes; - h1: HTMLAttributes; - h2: HTMLAttributes; - h3: HTMLAttributes; - h4: HTMLAttributes; - h5: HTMLAttributes; - h6: HTMLAttributes; - head: HTMLAttributes; - header: HTMLAttributes; - hgroup: HTMLAttributes; - hr: HTMLAttributes; - html: HTMLAttributes; - i: HTMLAttributes; - iframe: HTMLAttributes; - img: HTMLAttributes; - input: HTMLAttributes; - ins: HTMLAttributes; - kbd: HTMLAttributes; - keygen: HTMLAttributes; - label: HTMLAttributes; - legend: HTMLAttributes; - li: HTMLAttributes; - link: HTMLAttributes; - main: HTMLAttributes; - map: HTMLAttributes; - mark: HTMLAttributes; - marquee: HTMLAttributes; - menu: HTMLAttributes; - menuitem: HTMLAttributes; - meta: HTMLAttributes; - meter: HTMLAttributes; - nav: HTMLAttributes; - noscript: HTMLAttributes; - object: HTMLAttributes; - ol: HTMLAttributes; - optgroup: HTMLAttributes; - option: HTMLAttributes; - output: HTMLAttributes; - p: HTMLAttributes; - param: HTMLAttributes; - picture: HTMLAttributes; - pre: HTMLAttributes; - progress: HTMLAttributes; - q: HTMLAttributes; - rp: HTMLAttributes; - rt: HTMLAttributes; - ruby: HTMLAttributes; - s: HTMLAttributes; - samp: HTMLAttributes; - script: HTMLAttributes; - section: HTMLAttributes; - select: HTMLAttributes; - slot: HTMLAttributes; - small: HTMLAttributes; - source: HTMLAttributes; - span: HTMLAttributes; - strong: HTMLAttributes; - style: HTMLAttributes; - sub: HTMLAttributes; - summary: HTMLAttributes; - sup: HTMLAttributes; - table: HTMLAttributes; - tbody: HTMLAttributes; - td: HTMLAttributes; - textarea: HTMLAttributes; - tfoot: HTMLAttributes; - th: HTMLAttributes; - thead: HTMLAttributes; - time: HTMLAttributes; - title: HTMLAttributes; - tr: HTMLAttributes; - track: HTMLAttributes; - u: HTMLAttributes; - ul: HTMLAttributes; - var: HTMLAttributes; - video: HTMLAttributes; - wbr: HTMLAttributes; - - //SVG - svg: SVGAttributes; - animate: SVGAttributes; - circle: SVGAttributes; - animateTransform: SVGAttributes; - clipPath: SVGAttributes; - defs: SVGAttributes; - desc: SVGAttributes; - ellipse: SVGAttributes; - feBlend: SVGAttributes; - feColorMatrix: SVGAttributes; - feComponentTransfer: SVGAttributes; - feComposite: SVGAttributes; - feConvolveMatrix: SVGAttributes; - feDiffuseLighting: SVGAttributes; - feDisplacementMap: SVGAttributes; - feDropShadow: SVGAttributes; - feFlood: SVGAttributes; - feFuncA: SVGAttributes; - feFuncB: SVGAttributes; - feFuncG: SVGAttributes; - feFuncR: SVGAttributes; - feGaussianBlur: SVGAttributes; - feImage: SVGAttributes; - feMerge: SVGAttributes; - feMergeNode: SVGAttributes; - feMorphology: SVGAttributes; - feOffset: SVGAttributes; - feSpecularLighting: SVGAttributes; - feTile: SVGAttributes; - feTurbulence: SVGAttributes; - filter: SVGAttributes; - foreignObject: SVGAttributes; - g: SVGAttributes; - image: SVGAttributes; - line: SVGAttributes; - linearGradient: SVGAttributes; - marker: SVGAttributes; - mask: SVGAttributes; - path: SVGAttributes; - pattern: SVGAttributes; - polygon: SVGAttributes; - polyline: SVGAttributes; - radialGradient: SVGAttributes; - rect: SVGAttributes; - stop: SVGAttributes; - symbol: SVGAttributes; - text: SVGAttributes; - tspan: SVGAttributes; - use: SVGAttributes; - - [tag: string]: any; - } -} diff --git a/src/core/render/jsx/types/jsx_base.ts b/src/core/render/jsx/types/jsx_base.ts deleted file mode 100644 index 1965c58eda2..00000000000 --- a/src/core/render/jsx/types/jsx_base.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright Builder.io, Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://github.com/BuilderIO/qwik/blob/main/LICENSE - */ - -import type { EntityConstructor, QRL } from '../../../'; - -interface BaseProps { - /** - * Declare `Injector` `Entity` providers. - * - * See: `Injector`, `Entity` - */ - 'decl:entity'?: EntityConstructor[]; - - /** - * Declare component template. - */ - 'decl:template'?: QRL; -} - -interface BaseEvents { - /** - * Event fired when DOM is first loaded - */ - 'on:qInit'?: QRL; - - // TODO: document - 'on:qInterval'?: QRL; - - // TODO: document - 'on:qTimeout'?: QRL; - - // TODO: document - 'on:qRender'?: QRL; -} - -export interface JSXBase extends BaseProps, BaseEvents {} diff --git a/src/jsx_runtime.ts b/src/jsx_runtime.ts index f4e835447f5..937d6b19aa8 100644 --- a/src/jsx_runtime.ts +++ b/src/jsx_runtime.ts @@ -1,2 +1,2 @@ export { jsx, jsxs, jsxDEV, Fragment } from '@builder.io/qwik'; -export type { JSXInternal as JSX } from '@builder.io/qwik'; +export type { QwikJSX as JSX } from '@builder.io/qwik';