import { HTMLTag } from '@ktjs/shared'; import { InputElementTag } from '@ktjs/shared'; import { JSXTag } from '@ktjs/shared'; import { MathMLTag } from '@ktjs/shared'; import { otherstring } from '@ktjs/shared'; import { SVGTag } from '@ktjs/shared'; declare type AliasElement = Element; export declare function applyAttr(element: JSX.Element, attr: KTReactifyProps): void; declare interface AttributesMap { a: BaseAttr & KTMaybeReactiveProps<{ download?: string; href?: string; hreflang?: string; ping?: string; referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; rel?: string; target?: '_self' | '_blank' | '_parent' | '_top' | string; type?: string; }>; area: BaseAttr & KTMaybeReactiveProps<{ alt?: string; coords?: string; download?: string; href?: string; ping?: string; referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; rel?: string; shape?: 'rect' | 'circle' | 'poly' | 'default'; target?: '_self' | '_blank' | '_parent' | '_top' | string; }>; audio: BaseAttr & KTMaybeReactiveProps<{ autoplay?: boolean; controls?: boolean; crossorigin?: 'anonymous' | 'use-credentials' | ''; loop?: boolean; muted?: boolean; preload?: 'none' | 'metadata' | 'auto' | ''; src?: string; }>; base: BaseAttr & KTMaybeReactiveProps<{ href?: string; target?: '_self' | '_blank' | '_parent' | '_top' | string; }>; body: BaseAttr & KTMaybeReactiveProps<{}>; br: BaseAttr & KTMaybeReactiveProps<{}>; button: BaseAttr & KTMaybeReactiveProps<{ disabled?: boolean; form?: string; formaction?: string; formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; formmethod?: 'get' | 'post' | 'dialog'; formnovalidate?: boolean; formtarget?: '_self' | '_blank' | '_parent' | '_top' | string; name?: string; type?: 'submit' | 'reset' | 'button'; value?: string; }>; canvas: BaseAttr & KTMaybeReactiveProps<{ height?: number | string; width?: number | string; }>; caption: BaseAttr & KTMaybeReactiveProps<{}>; col: BaseAttr & KTMaybeReactiveProps<{ span?: number | string; }>; colgroup: BaseAttr & KTMaybeReactiveProps<{ span?: number | string; }>; data: BaseAttr & KTMaybeReactiveProps<{ value?: string; }>; datalist: BaseAttr & KTMaybeReactiveProps<{}>; del: BaseAttr & KTMaybeReactiveProps<{ cite?: string; datetime?: string; }>; details: BaseAttr & KTMaybeReactiveProps<{ open?: boolean; }>; dialog: BaseAttr & KTMaybeReactiveProps<{ open?: boolean; }>; embed: BaseAttr & KTMaybeReactiveProps<{ height?: number | string; src?: string; type?: string; width?: number | string; }>; fieldset: BaseAttr & KTMaybeReactiveProps<{ disabled?: boolean; form?: string; name?: string; }>; form: BaseAttr & KTMaybeReactiveProps<{ 'accept-charset'?: string; action?: string; autocomplete?: 'on' | 'off'; enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring; name?: string; novalidate?: boolean; target?: '_self' | '_blank' | '_parent' | '_top' | string; }>; head: BaseAttr & KTMaybeReactiveProps<{}>; hr: BaseAttr & KTMaybeReactiveProps<{}>; html: BaseAttr & KTMaybeReactiveProps<{}>; iframe: BaseAttr & KTMaybeReactiveProps<{ allow?: string; allowfullscreen?: boolean; allowpaymentrequest?: boolean; height?: number | string; loading?: 'eager' | 'lazy'; name?: string; referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; sandbox?: string; src?: string; srcdoc?: string; width?: number | string; }>; img: BaseAttr & KTMaybeReactiveProps<{ alt?: string; crossorigin?: 'anonymous' | 'use-credentials' | ''; decoding?: 'sync' | 'async' | 'auto'; height?: number | string; ismap?: boolean; loading?: 'eager' | 'lazy'; referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; sizes?: string; src?: string; srcset?: string; usemap?: string; width?: number | string; }>; input: BaseAttr & KTMaybeReactiveProps<{ accept?: string; alt?: string; autocomplete?: string; checked?: boolean; dirname?: string; disabled?: boolean; form?: string; formaction?: string; formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'; formmethod?: 'get' | 'post'; formnovalidate?: boolean; formtarget?: '_self' | '_blank' | '_parent' | '_top' | string; height?: number | string; list?: string; max?: number | string; maxlength?: number | string; min?: number | string; minlength?: number | string; multiple?: boolean; name?: string; pattern?: string; placeholder?: string; readonly?: boolean; required?: boolean; size?: number | string; src?: string; step?: number | string; type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week'; value?: string; width?: number | string; }>; ins: BaseAttr & KTMaybeReactiveProps<{ cite?: string; datetime?: string; }>; label: BaseAttr & KTMaybeReactiveProps<{ for?: string; }>; legend: BaseAttr & KTMaybeReactiveProps<{}>; li: BaseAttr & KTMaybeReactiveProps<{ value?: number | string; }>; link: BaseAttr & KTMaybeReactiveProps<{ as?: string; crossorigin?: 'anonymous' | 'use-credentials' | ''; disabled?: boolean; href?: string; hreflang?: string; imagesizes?: string; imagesrcset?: string; integrity?: string; media?: string; referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; rel?: string; sizes?: string; type?: string; }>; map: BaseAttr & KTMaybeReactiveProps<{ name?: string; }>; menu: BaseAttr & KTMaybeReactiveProps<{}>; meta: BaseAttr & KTMaybeReactiveProps<{ charset?: string; content?: string; 'http-equiv'?: 'content-security-policy' | 'content-type' | 'default-style' | 'refresh' | string; name?: string; }>; meter: BaseAttr & KTMaybeReactiveProps<{ form?: string; high?: number | string; low?: number | string; max?: number | string; min?: number | string; optimum?: number | string; value?: number | string; }>; object: BaseAttr & KTMaybeReactiveProps<{ data?: string; form?: string; height?: number | string; name?: string; type?: string; usemap?: string; width?: number | string; }>; ol: BaseAttr & KTMaybeReactiveProps<{ reversed?: boolean; start?: number | string; type?: '1' | 'a' | 'A' | 'i' | 'I'; }>; optgroup: BaseAttr & KTMaybeReactiveProps<{ disabled?: boolean; label?: string; }>; option: BaseAttr & KTMaybeReactiveProps<{ disabled?: boolean; label?: string; selected?: boolean; value?: string; }>; output: BaseAttr & KTMaybeReactiveProps<{ for?: string; form?: string; name?: string; }>; picture: BaseAttr & KTMaybeReactiveProps<{}>; pre: BaseAttr & KTMaybeReactiveProps<{}>; progress: BaseAttr & KTMaybeReactiveProps<{ max?: number | string; value?: number | string; }>; q: BaseAttr & KTMaybeReactiveProps<{ cite?: string; }>; blockquote: BaseAttr & KTMaybeReactiveProps<{ cite?: string; }>; script: BaseAttr & KTMaybeReactiveProps<{ async?: boolean; crossorigin?: 'anonymous' | 'use-credentials' | ''; defer?: boolean; integrity?: string; nomodule?: boolean; referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url'; src?: string; type?: string; }>; select: BaseAttr & KTMaybeReactiveProps<{ autocomplete?: string; disabled?: boolean; form?: string; multiple?: boolean; name?: string; required?: boolean; size?: number | string; }>; slot: BaseAttr & KTMaybeReactiveProps<{ name?: string; }>; source: BaseAttr & KTMaybeReactiveProps<{ height?: number | string; media?: string; sizes?: string; src?: string; srcset?: string; type?: string; width?: number | string; }>; style: BaseAttr & KTMaybeReactiveProps<{ media?: string; }>; table: BaseAttr & KTMaybeReactiveProps<{}>; tbody: BaseAttr & KTMaybeReactiveProps<{}>; tfoot: BaseAttr & KTMaybeReactiveProps<{}>; thead: BaseAttr & KTMaybeReactiveProps<{}>; td: BaseAttr & KTMaybeReactiveProps<{ colspan?: number | string; headers?: string; rowspan?: number | string; }>; th: BaseAttr & KTMaybeReactiveProps<{ abbr?: string; colspan?: number | string; headers?: string; rowspan?: number | string; scope?: 'row' | 'col' | 'rowgroup' | 'colgroup'; }>; template: BaseAttr & KTMaybeReactiveProps<{}>; textarea: BaseAttr & KTMaybeReactiveProps<{ autocomplete?: string; cols?: number | string; dirname?: string; disabled?: boolean; form?: string; maxlength?: number | string; minlength?: number | string; name?: string; placeholder?: string; readonly?: boolean; required?: boolean; wrap?: 'hard' | 'soft' | 'off'; }> & { rows?: KTMaybeReactive | KTMaybeReactive; }; time: BaseAttr & KTMaybeReactiveProps<{ datetime?: string; }>; title: BaseAttr & KTMaybeReactiveProps<{}>; tr: BaseAttr & KTMaybeReactiveProps<{}>; track: BaseAttr & KTMaybeReactiveProps<{ default?: boolean; kind?: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'; label?: string; src?: string; srclang?: string; }>; ul: BaseAttr & KTMaybeReactiveProps<{}>; video: BaseAttr & KTMaybeReactiveProps<{ autoplay?: boolean; controls?: boolean; crossorigin?: 'anonymous' | 'use-credentials' | ''; height?: number | string; loop?: boolean; muted?: boolean; playsinline?: boolean; poster?: string; preload?: 'none' | 'metadata' | 'auto' | ''; src?: string; width?: number | string; }>; abbr: BaseAttr & KTMaybeReactiveProps<{}>; address: BaseAttr & KTMaybeReactiveProps<{}>; article: BaseAttr & KTMaybeReactiveProps<{}>; aside: BaseAttr & KTMaybeReactiveProps<{}>; b: BaseAttr & KTMaybeReactiveProps<{}>; bdi: BaseAttr & KTMaybeReactiveProps<{}>; bdo: BaseAttr & KTMaybeReactiveProps<{}>; cite: BaseAttr & KTMaybeReactiveProps<{}>; code: BaseAttr & KTMaybeReactiveProps<{}>; dd: BaseAttr & KTMaybeReactiveProps<{}>; dfn: BaseAttr & KTMaybeReactiveProps<{}>; div: BaseAttr & KTMaybeReactiveProps<{}>; dl: BaseAttr & KTMaybeReactiveProps<{}>; dt: BaseAttr & KTMaybeReactiveProps<{}>; em: BaseAttr & KTMaybeReactiveProps<{}>; figcaption: BaseAttr & KTMaybeReactiveProps<{}>; figure: BaseAttr & KTMaybeReactiveProps<{}>; footer: BaseAttr & KTMaybeReactiveProps<{}>; h1: BaseAttr & KTMaybeReactiveProps<{}>; h2: BaseAttr & KTMaybeReactiveProps<{}>; h3: BaseAttr & KTMaybeReactiveProps<{}>; h4: BaseAttr & KTMaybeReactiveProps<{}>; h5: BaseAttr & KTMaybeReactiveProps<{}>; h6: BaseAttr & KTMaybeReactiveProps<{}>; header: BaseAttr & KTMaybeReactiveProps<{}>; hgroup: BaseAttr & KTMaybeReactiveProps<{}>; i: BaseAttr & KTMaybeReactiveProps<{}>; kbd: BaseAttr & KTMaybeReactiveProps<{}>; main: BaseAttr & KTMaybeReactiveProps<{}>; mark: BaseAttr & KTMaybeReactiveProps<{}>; nav: BaseAttr & KTMaybeReactiveProps<{}>; noscript: BaseAttr & KTMaybeReactiveProps<{}>; p: BaseAttr & KTMaybeReactiveProps<{}>; rp: BaseAttr & KTMaybeReactiveProps<{}>; rt: BaseAttr & KTMaybeReactiveProps<{}>; ruby: BaseAttr & KTMaybeReactiveProps<{}>; s: BaseAttr & KTMaybeReactiveProps<{}>; samp: BaseAttr & KTMaybeReactiveProps<{}>; search: BaseAttr & KTMaybeReactiveProps<{}>; section: BaseAttr & KTMaybeReactiveProps<{}>; small: BaseAttr & KTMaybeReactiveProps<{}>; span: BaseAttr & KTMaybeReactiveProps<{}>; strong: BaseAttr & KTMaybeReactiveProps<{}>; sub: BaseAttr & KTMaybeReactiveProps<{}>; summary: BaseAttr & KTMaybeReactiveProps<{}>; sup: BaseAttr & KTMaybeReactiveProps<{}>; u: BaseAttr & KTMaybeReactiveProps<{}>; var: BaseAttr & KTMaybeReactiveProps<{}>; wbr: BaseAttr & KTMaybeReactiveProps<{}>; svg: BaseAttr & KTMaybeReactiveProps<{ class?: string; style?: string | Partial; width?: number | string; height?: number | string; viewBox?: string; xmlns?: string; fill?: string; stroke?: string; strokeWidth?: number | string; strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit'; strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit'; strokeDasharray?: string; strokeDashoffset?: number | string; opacity?: number | string; preserveAspectRatio?: string; transform?: string; x?: number | string; y?: number | string; rx?: number | string; ry?: number | string; r?: number | string; cx?: number | string; cy?: number | string; d?: string; points?: string; pathLength?: number | string; viewbox?: string; role?: string; focusable?: boolean | 'true' | 'false'; xlinkHref?: string; }>; } declare const enum AType { Null = "kt-null", Content = "kt-content", Fragment = "kt-fragment", For = "kt-for", If = "kt-if", Async = "kt-async" } declare type BaseAttr = KTPrefixedEventAttribute & { [k: string]: KTMaybeReactive; [k: `on:${string}`]: ((...args: any[]) => any) | undefined; } & KTMaybeReactiveProps<{ id?: string; name?: string; class?: string; className?: string; }> & { style?: string | Partial | KTReactify | KTReactify>; }; export declare type ChangeListener = (newValue: T, oldValue: T) => void; /** * Create a computed value that automatically updates when its dependencies change. * @param calculator synchronous function that calculates the value of the computed. It should not have side effects. * @param dependencies an array of reactive dependencies that the computed value depends on. The computed value will automatically update when any of these dependencies change. */ export declare const computed: (calculator: () => T, dependencies: Array>) => KTComputed; /** * Fragment - Container component for managing arrays of child elements * * Features: * 1. Returns a comment anchor node, child elements are inserted after the anchor * 2. Supports reactive arrays, automatically updates DOM when array changes * 3. Basic version uses simple replacement algorithm (remove all old elements, insert all new elements) * 4. Future enhancement: key-based optimization * * Usage example: * ```tsx * const children = ref([
A
,
B
]); * const fragment = ; * document.body.appendChild(fragment); * * // Automatic update * children.value = [
C
,
D
]; * ``` */ declare function createFragment(props: FragmentProps): JSX.Element & KTFragmentAnchor; export declare const createMathMLElement: (tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML; export declare const createSVGElement: (tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML; export declare type Dereactive = T extends KTReactive ? U : T; /** * Register a reactive effect with options. * @param effectFn The effect function to run when dependencies change * @param reactives The reactive dependencies * @param options Effect options: lazy, onCleanup, debugName * @returns stop function to remove all listeners */ export declare function effect(effectFn: () => void, reactives: Array>, options?: Partial): () => void; /** * Fragment support - returns an array of children * Enhanced Fragment component that manages arrays of elements */ export declare const Fragment: typeof createFragment; declare interface FragmentProps { ref?: KTRef; children: SingleContent[]; } /** * Create an enhanced HTMLElement. * - Only supports HTMLElements, **NOT** SVGElements or other Elements. * @param tag tag of an `HTMLElement` * @param attr attribute object or className * @param content a string or an array of HTMLEnhancedElement as child nodes * * ## About * @package @ktjs/core * @author Kasukabe Tsumugi * @version 0.40.26 (Last Update: 2026.05.24 06:13:25.666) * @license MIT * @link https://github.com/baendlorel/kt.js * @link https://baendlorel.github.io/ Welcome to my site! * @description Core functionality for kt.js - DOM manipulation utilities with JSX/TSX support * @copyright Copyright (c) 2026 Kasukabe Tsumugi. All rights reserved. */ declare const h: (tag: T, attr?: KTRawAttr, content?: KTRawContent) => HTML; export { h as createElement } export { h } export declare type HTML = T extends SVGTag ? SVGElementTagNameMap[T] : T extends HTMLTag ? HTMLElementTagNameMap[T] : T extends MathMLTag ? MathMLElementTagNameMap[T] : HTMLElement; export { HTMLTag } export { InputElementTag } export declare const isComputed: (o: any) => o is KTComputed; /** * Only checks if `ktype` is a number, which is the common property of all KTReactive instances. */ export declare const isKT: (o: any) => o is KTReactive; /** * @returns `true` for both `KTRef` and `KTSubRef`, since `KTSubRef` is a subclass of `KTRef` */ export declare const isRef: (o: any) => o is KTRef; export declare const isRefExact: (o: any) => o is KTRef; export declare const isSubRef: (o: any) => o is KTSubRef; export declare namespace JSX { export type Element = AliasElement; export interface IntrinsicElements { [k: string]: AttributesMap['div']; html: AttributesMap['html']; head: AttributesMap['head']; title: AttributesMap['title']; base: AttributesMap['base']; link: AttributesMap['link']; meta: AttributesMap['meta']; body: AttributesMap['body']; header: AttributesMap['header']; footer: AttributesMap['footer']; nav: AttributesMap['nav']; main: AttributesMap['main']; section: AttributesMap['section']; article: AttributesMap['article']; aside: AttributesMap['aside']; h1: AttributesMap['h1']; h2: AttributesMap['h2']; h3: AttributesMap['h3']; h4: AttributesMap['h4']; h5: AttributesMap['h5']; h6: AttributesMap['h6']; p: AttributesMap['p']; pre: AttributesMap['pre']; code: AttributesMap['code']; strong: AttributesMap['strong']; small: AttributesMap['small']; em: AttributesMap['em']; br: AttributesMap['br']; i: AttributesMap['i']; ul: AttributesMap['ul']; ol: AttributesMap['ol']; li: AttributesMap['li']; table: AttributesMap['table']; thead: AttributesMap['thead']; tbody: AttributesMap['tbody']; tfoot: AttributesMap['tfoot']; tr: AttributesMap['tr']; th: AttributesMap['th']; td: AttributesMap['td']; form: AttributesMap['form']; label: AttributesMap['label']; input: AttributesMap['input']; textarea: AttributesMap['textarea']; select: AttributesMap['select']; option: AttributesMap['option']; optgroup: AttributesMap['optgroup']; button: AttributesMap['button']; fieldset: AttributesMap['fieldset']; legend: AttributesMap['legend']; datalist: AttributesMap['datalist']; output: AttributesMap['output']; img: AttributesMap['img']; picture: AttributesMap['picture']; source: AttributesMap['source']; audio: AttributesMap['audio']; video: AttributesMap['video']; track: AttributesMap['track']; iframe: AttributesMap['iframe']; embed: AttributesMap['embed']; object: AttributesMap['object']; canvas: AttributesMap['canvas']; a: AttributesMap['a'] & SVGAttributesMap['a']; area: AttributesMap['area']; map: AttributesMap['map']; details: AttributesMap['details']; dialog: AttributesMap['dialog']; summary: AttributesMap['summary']; slot: AttributesMap['slot']; script: AttributesMap['script']; style: AttributesMap['style']; figure: AttributesMap['figure']; figcaption: AttributesMap['figcaption']; blockquote: AttributesMap['blockquote']; q: AttributesMap['q']; div: AttributesMap['div']; span: AttributesMap['span']; address: AttributesMap['address']; abbr: AttributesMap['abbr']; b: AttributesMap['b']; cite: AttributesMap['cite']; dl: AttributesMap['dl']; dt: AttributesMap['dt']; dd: AttributesMap['dd']; hr: AttributesMap['hr']; svg: AttributesMap['svg']; animate: SVGAttributesMap['animate']; animateMotion: SVGAttributesMap['animateMotion']; animateTransform: SVGAttributesMap['animateTransform']; circle: SVGAttributesMap['circle']; clipPath: SVGAttributesMap['clipPath']; defs: SVGAttributesMap['defs']; desc: SVGAttributesMap['desc']; ellipse: SVGAttributesMap['ellipse']; feBlend: SVGAttributesMap['feBlend']; feColorMatrix: SVGAttributesMap['feColorMatrix']; feComponentTransfer: SVGAttributesMap['feComponentTransfer']; feComposite: SVGAttributesMap['feComposite']; feConvolveMatrix: SVGAttributesMap['feConvolveMatrix']; feDiffuseLighting: SVGAttributesMap['feDiffuseLighting']; feDisplacementMap: SVGAttributesMap['feDisplacementMap']; feDistantLight: SVGAttributesMap['feDistantLight']; feDropShadow: SVGAttributesMap['feDropShadow']; feFlood: SVGAttributesMap['feFlood']; feFuncA: SVGAttributesMap['feFuncA']; feFuncB: SVGAttributesMap['feFuncB']; feFuncG: SVGAttributesMap['feFuncG']; feFuncR: SVGAttributesMap['feFuncR']; feGaussianBlur: SVGAttributesMap['feGaussianBlur']; feImage: SVGAttributesMap['feImage']; feMerge: SVGAttributesMap['feMerge']; feMergeNode: SVGAttributesMap['feMergeNode']; feMorphology: SVGAttributesMap['feMorphology']; feOffset: SVGAttributesMap['feOffset']; fePointLight: SVGAttributesMap['fePointLight']; feSpecularLighting: SVGAttributesMap['feSpecularLighting']; feSpotLight: SVGAttributesMap['feSpotLight']; feTile: SVGAttributesMap['feTile']; feTurbulence: SVGAttributesMap['feTurbulence']; filter: SVGAttributesMap['filter']; foreignObject: SVGAttributesMap['foreignObject']; g: SVGAttributesMap['g']; image: SVGAttributesMap['image']; line: SVGAttributesMap['line']; linearGradient: SVGAttributesMap['linearGradient']; marker: SVGAttributesMap['marker']; mask: SVGAttributesMap['mask']; metadata: SVGAttributesMap['metadata']; mpath: SVGAttributesMap['mpath']; path: SVGAttributesMap['path']; pattern: SVGAttributesMap['pattern']; polygon: SVGAttributesMap['polygon']; polyline: SVGAttributesMap['polyline']; radialGradient: SVGAttributesMap['radialGradient']; rect: SVGAttributesMap['rect']; set: SVGAttributesMap['set']; stop: SVGAttributesMap['stop']; switch: SVGAttributesMap['switch']; symbol: SVGAttributesMap['symbol']; text: SVGAttributesMap['text']; textPath: SVGAttributesMap['textPath']; tspan: SVGAttributesMap['tspan']; use: SVGAttributesMap['use']; view: SVGAttributesMap['view']; } export interface IntrinsicAttributes { /** * Make a reference to the created element */ ref?: KTRef; /** * Conditional rendering * - Provide a `KTRef` to make it reactive */ 'k-if'?: any; /** * Conditional rendering, must come after `k-if` * @throws Error if used without a preceding `k-if` or coexisting with another `k-if` */ 'k-else'?: any; /** * List rendering. Must provide an iterable or array-like `KTReactive` */ 'k-for'?: any; /** * List key. Use it with `k-for` */ 'k-key'?: any; /** * 2-way binding. Must provide a `KTRef` */ 'k-model'?: KTRef; /** * Raw HTML escape hatch. * - Provide a `KTRef` to make it reactive. * - Directly writes to `innerHTML` with no sanitization. * - Only use trusted HTML. * - Do not pass user-controlled strings unless you sanitize them yourself first. */ 'k-html'?: any; children?: KTRawContent; } export interface ElementChildrenAttribute { children: {}; } } export declare const jsx: JSXCreator; export declare type JSXCreator = (tag: JSXTag, props: KTAttribute) => JSX.Element; /** * JSX Development runtime - same as jsx but with additional dev checks */ export declare const jsxDEV: typeof jsx; /** * JSX runtime for React 17+ automatic runtime * This is called when using jsx: "react-jsx" or "react-jsxdev" */ export declare const jsxs: JSXCreator; declare abstract class KTAnchor extends Comment { readonly atype: AType; constructor(atype: AType); /** * [WARN] Different from `_remove`, removes the elements **and itself**. */ remove(): void; } export declare function KTAsync

(props: KTAsyncProps

): JSX.Element; declare interface KTAsyncProps

{ /** * Will be assigned as this Anchor */ ref?: KTRef; /** * Display this when loading the async component. */ skeleton?: JSX.Element; /** * Async Component(a promise holds an component) */ component: (props: P) => Thenable; props?: P; } export declare type KTAttribute = KTBaseAttribute & KTPrefixedEventAttribute; /** * Used to create enhanced HTML elements */ declare interface KTBaseAttribute { /** * Additional attributes are forwarded to the DOM as-is. * kt.js does not sanitize raw HTML, URLs, `srcdoc`, or native `on*` attribute values. * If you bind untrusted input here, sanitization is the application's responsibility. */ [k: string]: any; ref?: KTRef; /** * If a `KTRef` is bound, it will be reactive; otherwise, it will be static. */ 'k-if'?: any; /** * Register two-way data binding between an input element and a KTRef. * - Default to register `input` event and `value` property(`checked` for checkboxes and radios). */ 'k-model'?: KTRef; /** * Raw HTML escape hatch. Directly assigns to `innerHTML`. * - Provide a `KTRef` to make it reactive. * - No sanitization is performed by kt.js. * - Only pass trusted HTML. * - Never bind user-controlled strings here without application-level sanitization. */ 'k-html'?: any; id?: string; class?: string; className?: string; style?: string | Partial; type?: 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'datetime-local' | 'time' | 'month' | 'week' | 'color' | 'range' | 'file' | 'checkbox' | 'radio' | 'hidden' | 'submit' | 'reset' | 'button' | 'image' | otherstring; for?: string; name?: string; title?: string; placeholder?: string; contenteditable?: boolean; value?: any; valueAsDate?: Date; valueAsNumber?: number; label?: string; disabled?: boolean; min?: string | number; max?: string | number; step?: string | number; selected?: boolean; checked?: boolean; action?: string; method?: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | 'CONNECT' | 'TRACE' | otherstring; } export declare class KTComputed extends KTReactive { readonly ktype = KType.Computed; constructor(calculator: () => T, dependencies: Array>); notify(): this; unlisten(listener: ChangeListener): this; dispose(): void; } declare interface KTEffectOptions { lazy: boolean; onCleanup: () => void; debugName: string; owner: Node; } /** * KTFor - List rendering component with key-based optimization * Returns a Comment anchor node with rendered elements in anchor.list */ export declare function KTFor(props: KTForProps): KTForElement; declare class KTForAnchor extends KTAnchor { constructor(list: KTForList, key: Required>['key'], map: Required>['map']); } declare type KTForElement = JSX.Element & KTForAnchor; declare type KTForList = TList | KTReactive; export declare interface KTForProps { list: KTForList; key?: (item: TList[number], index: number, array: TList) => any; map?: (item: TList[number], index: number, array: TList) => SingleContent; } declare class KTFragmentAnchor extends KTAnchor { constructor(children: SingleContent[]); } /** * @param cond Can be reactive or static. */ export declare function KTIf(cond: any, tagIf: JSXTag, pIf: PropGetter, tagElse?: JSXTag, pElse?: PropGetter): JSX.Element; export declare interface KTListenOptions { owner?: Node; } export declare type KTMaybeReactive = T | KTReactify; export declare type KTMaybeReactiveProps = { [K in keyof T]: K extends `on:${string}` ? T[K] : KTMaybeReactive> | T[K]; }; export declare type KTPrefixedEventAttribute = { [EventName in keyof HTMLElementEventMap as `on:${EventName}`]?: (ev: HTMLElementEventMap[EventName]) => void; }; export declare type KTRawAttr = KTAttribute | null | undefined | '' | false; export declare type KTRawContent = SingleContent | MultiContent; /** * Makes `KTReactify<'a' | 'b'>` to be `KTReactive<'a' | 'b'>` */ export declare type KTReactify = [T] extends [KTReactive] ? KTReactive : KTReactive; export declare type KTReactifyObject = { [K in keyof T]: KTReactifySplit; }; export declare type KTReactifyProps = { [K in keyof T]: KTReactifySplit> | T[K]; }; /** * Makes `KTReactify<'a' | 'b'> to be KTReactive<'a'> | KTReactive<'b'>` */ export declare type KTReactifySplit = T extends boolean ? KTReactive : T extends any ? KTReactive : never; export declare abstract class KTReactive { readonly kid: number; constructor(value: T); get value(): T; set value(newValue: T); listen(listener: ChangeListener, options?: KTListenOptions | Node): this; unlisten(listener: ChangeListener): this; unlistenAll(): this; notify(): this; /** * Create a computed value via current reactive value. * - No matter `this` is added to `dependencies` or not, it is always listened. * @param calculator A function that generates a new value based on current value. * @param dependencies optional other dependencies that the computed value depends on. */ map(calculator: (value: T) => U, dependencies?: Array>): KTComputed; /** * Make a computed value that checks if the reactive value is strictly equal to a specific value. * - Use `Object.is` for comparison. * - if `o` is reactive-like, it will be added to dependencies */ is(o: T | KTReactive): KTComputed; /** * Make a computed value that checks if the reactive value matches a specific object structure. * - Deeply match. * - if `o` is reactive-like, it will be added to dependencies */ match(o: object | KTReactive): KTComputed; /** * Generate a computed value based on this reactive, using keys to access nested properties. * - `reactive.get('a', 'b')` means a computed value to `this.value.a.b`. */ get(key0: K0, key1: K1, key2: K2): KTComputed; /** * Generate a computed value based on this reactive, using keys to access nested properties. * - `reactive.get('a', 'b')` means a computed value to `this.value.a.b`. */ get(key0: K0, key1: K1): KTComputed; /** * Generate a computed value based on this reactive, using keys to access nested properties. * - `reactive.get('a', 'b')` means a computed value to `this.value.a.b`. */ get(key0: K0): KTComputed; } export declare class KTRef extends KTReactive { readonly ktype: KType; constructor(_value: T); get value(): T; set value(newValue: T); /** * Used to mutate the value in-place. * - internal value is changed instantly, but the change listeners will be called in the next microtask. */ get draft(): T; notify(): this; /** * Derive a lighter sub-ref from this ref, using keys to access nested properties. * - `ref.subref('a', 'b')` means a sub-ref to `this.value.a.b`. Change it will also change `this.value` and trigger the listeners. * - `KTSubRef` is lighter than `KTRef`. */ subref(this: KTRef, key0: K0, key1: K1, key2: K2): KTSubRef; /** * Derive a lighter sub-ref from this ref, using keys to access nested properties. * - `ref.subref('a', 'b')` means a sub-ref to `this.value.a.b`. Change it will also change `this.value` and trigger the listeners. * - `KTSubRef` is lighter than `KTRef`. */ subref(this: KTRef, key0: K0, key1: K1): KTSubRef; /** * Derive a lighter sub-ref from this ref, using keys to access nested properties. * - `ref.subref('a', 'b')` means a sub-ref to `this.value.a.b`. Change it will also change `this.value` and trigger the listeners. * - `KTSubRef` is lighter than `KTRef`. */ subref(this: KTRef, key0: K0): KTSubRef; dispose(): void; } export declare class KTSubRef extends KTRef { readonly kid: number; readonly ktype: KType; readonly source: KTRef; constructor(source: KTRef, getter: (sv: KTReactive['value']) => T, setter: (s: object, newValue: T) => void); get value(): T; set value(newValue: T); listen(listener: ChangeListener, options?: KTListenOptions | Node): this; unlisten(listener: ChangeListener): this; dispose(): void; get(...args: any[]): KTComputed; /** * Only use it for object's nested properties. */ get draft(): T; } export declare const enum KType { Ref = 2, SubRef = 4, Computed = 8, Reactive = 10, /** * Used for custom reactive-like objects. */ Custom = 1073741824 } declare const mathml: MathMLCreator; export { mathml } export { mathml as mathmlRuntime } export declare type MathMLCreator = (tag: MathMLTag, props: KTAttribute) => JSX.Element; export { MathMLTag } declare type MultiContent = SingleContent[] | KTReactive; declare type PrimaryContent = Node | string | number | boolean | null | undefined; declare type PropGetter = () => KTAttribute; /** * Create a reactive reference to a value. The returned object has a single property `value` that holds the internal value. * @param value listened value */ export declare const ref: (value?: T) => KTRef; declare type SingleContent = PrimaryContent | KTReactive; declare const svg: SVGCreator; export { svg } export { svg as svgRuntime } declare interface SVGAttributesMap { a: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; x?: number | string; y?: number | string; }>; animate: AttributesMap['svg'] & KTMaybeReactiveProps<{ attributeName?: string; from?: string | number; to?: string | number; dur?: string; repeatCount?: string | number; }>; animateMotion: AttributesMap['svg'] & KTMaybeReactiveProps<{ path?: string; dur?: string; rotate?: string; }>; animateTransform: AttributesMap['svg'] & KTMaybeReactiveProps<{ type?: string; from?: string; to?: string; dur?: string; }>; circle: AttributesMap['svg'] & KTMaybeReactiveProps<{ cx?: number | string; cy?: number | string; r?: number | string; }>; clipPath: AttributesMap['svg'] & KTMaybeReactiveProps<{ clipPathUnits?: 'userSpaceOnUse' | 'objectBoundingBox'; }>; defs: AttributesMap['svg']; desc: AttributesMap['svg']; ellipse: AttributesMap['svg'] & KTMaybeReactiveProps<{ cx?: number | string; cy?: number | string; rx?: number | string; ry?: number | string; }>; feBlend: AttributesMap['svg'] & KTMaybeReactiveProps<{ in?: string; in2?: string; mode?: string; }>; feColorMatrix: AttributesMap['svg'] & KTMaybeReactiveProps<{ type?: 'matrix' | 'saturate' | 'hueRotate' | 'luminanceToAlpha'; values?: string; }>; feComponentTransfer: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feComposite: AttributesMap['svg'] & KTMaybeReactiveProps<{ in?: string; in2?: string; operator?: string; k1?: number | string; k2?: number | string; k3?: number | string; k4?: number | string; }>; feConvolveMatrix: AttributesMap['svg'] & KTMaybeReactiveProps<{ order?: string | number; kernelMatrix?: string; divisor?: string | number; bias?: string | number; }>; feDiffuseLighting: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feDisplacementMap: AttributesMap['svg'] & KTMaybeReactiveProps<{ in?: string; in2?: string; scale?: number | string; xChannelSelector?: string; yChannelSelector?: string; }>; feDistantLight: AttributesMap['svg'] & KTMaybeReactiveProps<{ azimuth?: number | string; elevation?: number | string; }>; feDropShadow: AttributesMap['svg'] & KTMaybeReactiveProps<{ dx?: number | string; dy?: number | string; stdDeviation?: number | string; floodColor?: string; floodOpacity?: number | string; }>; feFlood: AttributesMap['svg'] & KTMaybeReactiveProps<{ floodColor?: string; floodOpacity?: number | string; }>; feFuncA: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feFuncB: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feFuncG: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feFuncR: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feGaussianBlur: AttributesMap['svg'] & KTMaybeReactiveProps<{ stdDeviation?: number | string; edgeMode?: string; }>; feImage: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; }>; feMerge: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feMergeNode: AttributesMap['svg'] & KTMaybeReactiveProps<{ in?: string; }>; feMorphology: AttributesMap['svg'] & KTMaybeReactiveProps<{ operator?: 'erode' | 'dilate'; radius?: number | string; }>; feOffset: AttributesMap['svg'] & KTMaybeReactiveProps<{ dx?: number | string; dy?: number | string; }>; fePointLight: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; z?: number | string; }>; feSpecularLighting: AttributesMap['svg'] & KTMaybeReactiveProps<{ specularConstant?: number | string; specularExponent?: number | string; surfaceScale?: number | string; }>; feSpotLight: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; z?: number | string; pointsAtX?: number | string; pointsAtY?: number | string; pointsAtZ?: number | string; specularExponent?: number | string; limitingConeAngle?: number | string; }>; feTile: AttributesMap['svg'] & KTMaybeReactiveProps<{}>; feTurbulence: AttributesMap['svg'] & KTMaybeReactiveProps<{ baseFrequency?: number | string; numOctaves?: number | string; seed?: number | string; stitchTiles?: string; type?: 'fractalNoise' | 'turbulence'; }>; filter: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; width?: number | string; height?: number | string; filterUnits?: string; primitiveUnits?: string; }>; foreignObject: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; width?: number | string; height?: number | string; }>; g: AttributesMap['svg']; image: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; x?: number | string; y?: number | string; width?: number | string; height?: number | string; }>; line: AttributesMap['svg'] & KTMaybeReactiveProps<{ x1?: number | string; y1?: number | string; x2?: number | string; y2?: number | string; }>; linearGradient: AttributesMap['svg'] & KTMaybeReactiveProps<{ x1?: number | string; y1?: number | string; x2?: number | string; y2?: number | string; gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox'; gradientTransform?: string; }>; marker: AttributesMap['svg'] & KTMaybeReactiveProps<{ markerUnits?: string; markerWidth?: number | string; markerHeight?: number | string; refX?: number | string; refY?: number | string; orient?: string; }>; mask: AttributesMap['svg'] & KTMaybeReactiveProps<{ maskUnits?: string; maskContentUnits?: string; x?: number | string; y?: number | string; width?: number | string; height?: number | string; }>; metadata: AttributesMap['svg']; mpath: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; }>; path: AttributesMap['svg'] & KTMaybeReactiveProps<{ d?: string; pathLength?: number | string; }>; pattern: AttributesMap['svg'] & KTMaybeReactiveProps<{ patternUnits?: string; patternContentUnits?: string; width?: number | string; height?: number | string; x?: number | string; y?: number | string; }>; polygon: AttributesMap['svg'] & KTMaybeReactiveProps<{ points?: string; }>; polyline: AttributesMap['svg'] & KTMaybeReactiveProps<{ points?: string; }>; radialGradient: AttributesMap['svg'] & KTMaybeReactiveProps<{ cx?: number | string; cy?: number | string; r?: number | string; fx?: number | string; fy?: number | string; gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox'; gradientTransform?: string; }>; rect: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; width?: number | string; height?: number | string; rx?: number | string; ry?: number | string; }>; script: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; type?: string; }>; set: AttributesMap['svg'] & KTMaybeReactiveProps<{ attributeName?: string; to?: string | number; begin?: string; dur?: string; }>; stop: AttributesMap['svg'] & KTMaybeReactiveProps<{ offset?: number | string; stopColor?: string; stopOpacity?: number | string; }>; style: AttributesMap['svg'] & KTMaybeReactiveProps<{ media?: string; }>; svg: AttributesMap['svg']; switch: AttributesMap['svg']; symbol: AttributesMap['svg'] & KTMaybeReactiveProps<{ viewBox?: string; preserveAspectRatio?: string; }>; text: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; dx?: number | string; dy?: number | string; textLength?: number | string; }>; textPath: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; startOffset?: number | string; }>; title: AttributesMap['svg']; tspan: AttributesMap['svg'] & KTMaybeReactiveProps<{ x?: number | string; y?: number | string; dx?: number | string; dy?: number | string; }>; use: AttributesMap['svg'] & KTMaybeReactiveProps<{ href?: string; x?: number | string; y?: number | string; width?: number | string; height?: number | string; }>; view: AttributesMap['svg'] & KTMaybeReactiveProps<{ viewBox?: string; preserveAspectRatio?: string; }>; } export declare type SVGCreator = (tag: SVGTag, props: KTAttribute) => JSX.Element; export { SVGTag } declare interface Thenable { then: (onfulfilled?: (value: T) => any) => any; } /** * @returns it as is when it's already `isKT`. Otherwise wraps it with `ref`. */ export declare const toKT: (o: T | KTReactive) => KTReactive; export { }