Comparing version 2.1.2 to 2.1.3
@@ -6,2 +6,3 @@ import { reactive, ref } from "./src/utils"; | ||
import { RouterView, RouterLink, createRouter } from "./src/router"; | ||
import type * from './src/' | ||
export { | ||
@@ -8,0 +9,0 @@ el, |
{ | ||
"name": "araz", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.ts", |
@@ -1,7 +0,7 @@ | ||
import { VNode } from "./types"; | ||
export const fragment = ({ $children }) => $children; | ||
import { VNode, Children } from "./types"; | ||
export const fragment = ({ $children }: { $children: Children }) => $children; | ||
/** | ||
* Creates a virtual DOM element (VNode) with the provided tag, attributes, and children. | ||
* | ||
* | ||
* @param $tag - The HTML tag name of the element. | ||
@@ -11,3 +11,3 @@ * @param $attrs - The attributes to apply to the element. | ||
* @returns The created virtual DOM element (VNode). | ||
* | ||
* | ||
* @example | ||
@@ -25,8 +25,8 @@ *``` | ||
*/ | ||
export const el = ({$tag, $attrs = {}, $children = []} : VNode ) => { | ||
return { | ||
$tag, | ||
$attrs, | ||
$children, | ||
}; | ||
} | ||
export const el = ({ $tag, $attrs = {}, $children = [] }: VNode) => { | ||
return { | ||
$tag, | ||
$attrs, | ||
$children, | ||
}; | ||
}; |
149
src/types.ts
@@ -1,13 +0,111 @@ | ||
export type HTMLTags = 'a' | 'abbr' | 'address' | 'area' | 'article' | 'aside' | 'audio' | 'b' | | ||
'base' | 'bdi' | 'bdo' | 'blockquote' | 'body' | 'br' | 'button' | 'canvas' | 'caption' | | ||
'cite' | 'code' | 'col' | 'colgroup' | 'data' | 'datalist' | 'dd' | 'del' | 'details' | | ||
'dfn' | 'dialog' | 'div' | 'dl' | 'dt' | 'em' | 'embed' | 'fieldset' | 'figcaption' | | ||
'figure' | 'footer' | 'form' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'head' | 'header' | | ||
'hgroup' | 'hr' | 'html' | 'i' | 'iframe' | 'img' | 'input' | 'ins' | 'kbd' | 'label' | | ||
'legend' | 'li' | 'link' | 'main' | 'map' | 'mark' | 'meta' | 'meter' | 'nav' | 'noscript' | | ||
'object' | 'ol' | 'optgroup' | 'option' | 'output' | 'p' | 'param' | 'picture' | 'pre' | | ||
'progress' | 'q' | 'rp' | 'rt' | 'ruby' | 's' | 'samp' | 'section' | 'select' | | ||
'small' | 'source' | 'span' | 'strong' | 'style' | 'sub' | 'summary' | 'sup' | 'table' | | ||
'tbody' | 'td' | 'template' | 'textarea' | 'tfoot' | 'th' | 'thead' | 'time' | 'title' | | ||
'tr' | 'track' | 'u' | 'ul' | 'var' | 'video' | 'wbr'; | ||
export type HTMLTags = | ||
| "a" | ||
| "abbr" | ||
| "address" | ||
| "area" | ||
| "article" | ||
| "aside" | ||
| "audio" | ||
| "b" | ||
| "base" | ||
| "bdi" | ||
| "bdo" | ||
| "blockquote" | ||
| "body" | ||
| "br" | ||
| "button" | ||
| "canvas" | ||
| "caption" | ||
| "cite" | ||
| "code" | ||
| "col" | ||
| "colgroup" | ||
| "data" | ||
| "datalist" | ||
| "dd" | ||
| "del" | ||
| "details" | ||
| "dfn" | ||
| "dialog" | ||
| "div" | ||
| "dl" | ||
| "dt" | ||
| "em" | ||
| "embed" | ||
| "fieldset" | ||
| "figcaption" | ||
| "figure" | ||
| "footer" | ||
| "form" | ||
| "h1" | ||
| "h2" | ||
| "h3" | ||
| "h4" | ||
| "h5" | ||
| "h6" | ||
| "head" | ||
| "header" | ||
| "hgroup" | ||
| "hr" | ||
| "html" | ||
| "i" | ||
| "iframe" | ||
| "img" | ||
| "input" | ||
| "ins" | ||
| "kbd" | ||
| "label" | ||
| "legend" | ||
| "li" | ||
| "link" | ||
| "main" | ||
| "map" | ||
| "mark" | ||
| "meta" | ||
| "meter" | ||
| "nav" | ||
| "noscript" | ||
| "object" | ||
| "ol" | ||
| "optgroup" | ||
| "option" | ||
| "output" | ||
| "p" | ||
| "param" | ||
| "picture" | ||
| "pre" | ||
| "progress" | ||
| "q" | ||
| "rp" | ||
| "rt" | ||
| "ruby" | ||
| "s" | ||
| "samp" | ||
| "section" | ||
| "select" | ||
| "small" | ||
| "source" | ||
| "span" | ||
| "strong" | ||
| "style" | ||
| "sub" | ||
| "summary" | ||
| "sup" | ||
| "table" | ||
| "tbody" | ||
| "td" | ||
| "template" | ||
| "textarea" | ||
| "tfoot" | ||
| "th" | ||
| "thead" | ||
| "time" | ||
| "title" | ||
| "tr" | ||
| "track" | ||
| "u" | ||
| "ul" | ||
| "var" | ||
| "video" | ||
| "wbr"; | ||
@@ -19,16 +117,23 @@ export interface Mount { | ||
interface Attrs { | ||
style?: Partial<CSSStyleDeclaration> | string; | ||
class?: string | string[]; | ||
events?: Partial<GlobalEventHandlers>; | ||
[key: string]: string | number | boolean | Partial<CSSStyleDeclaration>| Partial<GlobalEventHandlers> | string[] | undefined; | ||
export interface Attrs { | ||
style?: Partial<CSSStyleDeclaration> | string; | ||
class?: string | string[]; | ||
events?: Partial<GlobalEventHandlers>; | ||
[key: string]: | ||
| string | ||
| number | ||
| boolean | ||
| Partial<CSSStyleDeclaration> | ||
| Partial<GlobalEventHandlers> | ||
| string[] | ||
| undefined; | ||
} | ||
export type Children = VNode | string | VNode[] | string[] ; | ||
export interface VNode { | ||
$tag: HTMLTags; | ||
$attrs?: Attrs; | ||
$children?: any; | ||
$tag: HTMLTags; | ||
$attrs?: Attrs; | ||
$children?: Children; | ||
} | ||
export interface Route { | ||
@@ -48,2 +153,2 @@ path: string; | ||
[K in keyof T]: T[K]; | ||
}; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15902
466