@solidjs/html 2.0.0-experimental.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@solidjs/html",
3
+ "description": "Build-less Tagged-Template-Literal Templating for Solid",
4
+ "version": "2.0.0-experimental.0",
5
+ "author": "Ryan Carniato",
6
+ "license": "MIT",
7
+ "homepage": "https://solidjs.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/solidjs/solid-html"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "main": "./dist/html.cjs",
16
+ "module": "./dist/html.js",
17
+ "types": "./types/index.d.ts",
18
+ "type": "module",
19
+ "sideEffects": false,
20
+ "files": [
21
+ "dist",
22
+ "types",
23
+ "package.json"
24
+ ],
25
+ "exports": {
26
+ ".": {
27
+ "types": "./types/index.d.ts",
28
+ "import": "./dist/html.js",
29
+ "require": "./dist/html.cjs"
30
+ },
31
+ "./dist/*": "./dist/*"
32
+ },
33
+ "peerDependencies": {
34
+ "@solidjs/web": "^2.0.0-experimental.0"
35
+ },
36
+ "devDependencies": {
37
+ "@solidjs/web": "2.0.0-experimental.0"
38
+ },
39
+ "scripts": {
40
+ "build": "npm-run-all -nl build:*",
41
+ "build:clean": "rimraf dist/ coverage/",
42
+ "build:js": "rollup -c",
43
+ "types": "npm-run-all -nl types:*",
44
+ "types:clean": "rimraf types/",
45
+ "types:html": "tsc --project ./tsconfig.json && ncp ../../node_modules/lit-dom-expressions/types/index.d.ts ./types/lit.d.ts"
46
+ }
47
+ }
@@ -0,0 +1,3 @@
1
+ import type { HTMLTag } from "./lit.js";
2
+ declare const html: HTMLTag;
3
+ export default html;
package/types/lit.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ type MountableElement = Element | Document | ShadowRoot | DocumentFragment | Node;
2
+ type ClassList =
3
+ | Record<string, boolean>
4
+ | Array<string | number | boolean | null | undefined | Record<string, boolean>>;
5
+ interface Runtime {
6
+ effect<T>(fn: (prev?: T) => T, effect: (value: T, prev?: T) => void, init?: T): void;
7
+ untrack<T>(fn: () => T): T;
8
+ insert(parent: MountableElement, accessor: any, marker?: Node | null, init?: any): any;
9
+ spread<T>(node: Element, accessor: (() => T) | T, isSVG?: Boolean, skipChildren?: Boolean): void;
10
+ createComponent(Comp: (props: any) => any, props: any): any;
11
+ addEventListener(
12
+ node: Element,
13
+ name: string,
14
+ handler: EventListener | EventListenerObject | (EventListenerObject & AddEventListenerOptions),
15
+ delegate: boolean
16
+ ): void;
17
+ delegateEvents(eventNames: string[]): void;
18
+ className(
19
+ node: Element,
20
+ value: string | ClassList,
21
+ isSVG?: boolean,
22
+ prev?: string | ClassList
23
+ ): void;
24
+ style(
25
+ node: Element,
26
+ value: {
27
+ [k: string]: string;
28
+ },
29
+ prev?: {
30
+ [k: string]: string;
31
+ }
32
+ ): void;
33
+ mergeProps(...sources: unknown[]): unknown;
34
+ dynamicProperty(props: any, key: string): any;
35
+ setAttribute(node: Element, name: string, value: any): void;
36
+ setAttributeNS(node: Element, namespace: string, name: string, value: any): void;
37
+ getPropAlias(prop: string, tagName: string): string | undefined;
38
+ Properties: Set<string>;
39
+ ChildProperties: Set<string>;
40
+ DelegatedEvents: Set<string>;
41
+ SVGElements: Set<string>;
42
+ SVGNamespace: Record<string, string>;
43
+ }
44
+ export type HTMLTag = {
45
+ (statics: TemplateStringsArray, ...args: unknown[]): Node | Node[];
46
+ };
47
+ export declare function createHTML(
48
+ r: Runtime,
49
+ {
50
+ delegateEvents,
51
+ functionBuilder
52
+ }?: {
53
+ delegateEvents?: boolean;
54
+ functionBuilder?: (...args: string[]) => Function;
55
+ }
56
+ ): HTMLTag;
57
+ export {};