@devansharora18/tardisjs 0.0.2
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/LICENSE +21 -0
- package/README.md +0 -0
- package/dist/bin/bin/create-tardis-app.d.ts +2 -0
- package/dist/bin/bin/tardis.d.ts +15 -0
- package/dist/bin/create-tardis-app.d.ts +2 -0
- package/dist/bin/create-tardis-app.js +2102 -0
- package/dist/bin/create-tardis-app.js.map +1 -0
- package/dist/bin/src/compiler/compiler.d.ts +3 -0
- package/dist/bin/src/lexer/lexer.d.ts +2 -0
- package/dist/bin/src/lexer/tokens.d.ts +8 -0
- package/dist/bin/src/parser/errors.d.ts +6 -0
- package/dist/bin/src/parser/parser.d.ts +3 -0
- package/dist/bin/src/parser/types.d.ts +67 -0
- package/dist/bin/src/runtime/events.d.ts +9 -0
- package/dist/bin/src/runtime/fetch.d.ts +11 -0
- package/dist/bin/src/runtime/index.d.ts +52 -0
- package/dist/bin/src/runtime/registry.d.ts +17 -0
- package/dist/bin/src/runtime/render.d.ts +11 -0
- package/dist/bin/src/runtime/router.d.ts +15 -0
- package/dist/bin/src/runtime/selector.d.ts +67 -0
- package/dist/bin/src/runtime/state.d.ts +9 -0
- package/dist/bin/src/runtime/styles.d.ts +9 -0
- package/dist/bin/tardis.d.ts +15 -0
- package/dist/bin/tardis.js +2086 -0
- package/dist/bin/tardis.js.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/runtime/bin/create-tardis-app.d.ts +2 -0
- package/dist/runtime/bin/tardis.d.ts +15 -0
- package/dist/runtime/index.cjs +829 -0
- package/dist/runtime/index.cjs.map +1 -0
- package/dist/runtime/index.mjs +791 -0
- package/dist/runtime/index.mjs.map +1 -0
- package/dist/runtime/src/compiler/compiler.d.ts +3 -0
- package/dist/runtime/src/lexer/lexer.d.ts +2 -0
- package/dist/runtime/src/lexer/tokens.d.ts +8 -0
- package/dist/runtime/src/parser/errors.d.ts +6 -0
- package/dist/runtime/src/parser/parser.d.ts +3 -0
- package/dist/runtime/src/parser/types.d.ts +67 -0
- package/dist/runtime/src/runtime/events.d.ts +9 -0
- package/dist/runtime/src/runtime/fetch.d.ts +11 -0
- package/dist/runtime/src/runtime/index.d.ts +52 -0
- package/dist/runtime/src/runtime/registry.d.ts +17 -0
- package/dist/runtime/src/runtime/render.d.ts +11 -0
- package/dist/runtime/src/runtime/router.d.ts +15 -0
- package/dist/runtime/src/runtime/selector.d.ts +67 -0
- package/dist/runtime/src/runtime/state.d.ts +9 -0
- package/dist/runtime/src/runtime/styles.d.ts +9 -0
- package/dist/src/compiler/compiler.d.ts +3 -0
- package/dist/src/lexer/lexer.d.ts +2 -0
- package/dist/src/lexer/tokens.d.ts +8 -0
- package/dist/src/parser/errors.d.ts +6 -0
- package/dist/src/parser/parser.d.ts +3 -0
- package/dist/src/parser/types.d.ts +67 -0
- package/dist/src/runtime/events.d.ts +9 -0
- package/dist/src/runtime/fetch.d.ts +11 -0
- package/dist/src/runtime/index.d.ts +52 -0
- package/dist/src/runtime/registry.d.ts +17 -0
- package/dist/src/runtime/render.d.ts +11 -0
- package/dist/src/runtime/router.d.ts +15 -0
- package/dist/src/runtime/selector.d.ts +67 -0
- package/dist/src/runtime/state.d.ts +9 -0
- package/dist/src/runtime/styles.d.ts +9 -0
- package/package.json +67 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ComponentInstance } from './registry';
|
|
2
|
+
import { StateValue } from './state';
|
|
3
|
+
export declare class DOMSelection {
|
|
4
|
+
readonly elements: HTMLElement[];
|
|
5
|
+
constructor(elements: HTMLElement[]);
|
|
6
|
+
private each;
|
|
7
|
+
focus(): this;
|
|
8
|
+
blur(): this;
|
|
9
|
+
hide(): this;
|
|
10
|
+
show(): this;
|
|
11
|
+
remove(): this;
|
|
12
|
+
toggle(): this;
|
|
13
|
+
disable(): this;
|
|
14
|
+
enable(): this;
|
|
15
|
+
addClass(cls: string): this;
|
|
16
|
+
removeClass(cls: string): this;
|
|
17
|
+
toggleClass(cls: string): this;
|
|
18
|
+
attr(key: string): string | null;
|
|
19
|
+
attr(key: string, val: string): this;
|
|
20
|
+
val(): string;
|
|
21
|
+
val(value: string): this;
|
|
22
|
+
rect(): DOMRect | null;
|
|
23
|
+
width(): number;
|
|
24
|
+
height(): number;
|
|
25
|
+
scrollIntoView(): this;
|
|
26
|
+
scrollTo(opts: ScrollToOptions): this;
|
|
27
|
+
fadeIn(): this;
|
|
28
|
+
fadeOut(): this;
|
|
29
|
+
slideDown(): this;
|
|
30
|
+
slideUp(): this;
|
|
31
|
+
$update(_key: string, _value: unknown): this;
|
|
32
|
+
$reset(_initial?: Record<string, StateValue>): this;
|
|
33
|
+
get methods(): Record<string, (...args: unknown[]) => this>;
|
|
34
|
+
}
|
|
35
|
+
export declare class ComponentSelection {
|
|
36
|
+
readonly instances: ComponentInstance[];
|
|
37
|
+
constructor(instances: ComponentInstance[]);
|
|
38
|
+
private eachEl;
|
|
39
|
+
focus(): this;
|
|
40
|
+
blur(): this;
|
|
41
|
+
hide(): this;
|
|
42
|
+
show(): this;
|
|
43
|
+
remove(): this;
|
|
44
|
+
toggle(): this;
|
|
45
|
+
disable(): this;
|
|
46
|
+
enable(): this;
|
|
47
|
+
addClass(cls: string): this;
|
|
48
|
+
removeClass(cls: string): this;
|
|
49
|
+
toggleClass(cls: string): this;
|
|
50
|
+
attr(key: string): string | null;
|
|
51
|
+
attr(key: string, val: string): this;
|
|
52
|
+
val(): string;
|
|
53
|
+
val(value: string): this;
|
|
54
|
+
rect(): DOMRect | null;
|
|
55
|
+
width(): number;
|
|
56
|
+
height(): number;
|
|
57
|
+
scrollIntoView(): this;
|
|
58
|
+
scrollTo(opts: ScrollToOptions): this;
|
|
59
|
+
fadeIn(): this;
|
|
60
|
+
fadeOut(): this;
|
|
61
|
+
slideDown(): this;
|
|
62
|
+
slideUp(): this;
|
|
63
|
+
$update(key: string, value: StateValue): this;
|
|
64
|
+
$reset(initial: Record<string, StateValue>): this;
|
|
65
|
+
get methods(): Record<string, (...args: unknown[]) => this>;
|
|
66
|
+
}
|
|
67
|
+
export declare function $(selector: string): DOMSelection | ComponentSelection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type StateValue = string | number | boolean | unknown[] | Record<string, unknown> | null;
|
|
2
|
+
export type ReactiveState = Record<string, StateValue>;
|
|
3
|
+
export declare function $batch(fn: () => void): void;
|
|
4
|
+
export declare function createState(initial: Record<string, StateValue>): ReactiveState;
|
|
5
|
+
export declare function registerDep(state: ReactiveState, key: string, updater: () => void): void;
|
|
6
|
+
export declare function withEffect<T>(effect: () => void, fn: () => T): T;
|
|
7
|
+
export declare function $update(state: ReactiveState, key: string, value: StateValue): void;
|
|
8
|
+
export declare function $toggle(state: ReactiveState, key: string): void;
|
|
9
|
+
export declare function $reset(state: ReactiveState, initial: Record<string, StateValue>): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactiveState } from './state';
|
|
2
|
+
export type StyleMode = 'tailwind' | 'css';
|
|
3
|
+
export type StyleRules = Record<string, string>;
|
|
4
|
+
export interface StylesObject {
|
|
5
|
+
mode: StyleMode;
|
|
6
|
+
rules: StyleRules;
|
|
7
|
+
resolve(props: Record<string, unknown>, state: ReactiveState): string;
|
|
8
|
+
}
|
|
9
|
+
export declare function createStyles(mode: StyleMode, rules: StyleRules, props: Record<string, unknown>, state: ReactiveState): StylesObject;
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devansharora18/tardisjs",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Smaller on the outside. A ~5KB jQuery-inspired frontend framework.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.mjs",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"tardis": "./dist/bin/tardis.js",
|
|
11
|
+
"create-tardis-app": "./dist/bin/create-tardis-app.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"require": "./dist/index.cjs"
|
|
17
|
+
},
|
|
18
|
+
"./runtime": {
|
|
19
|
+
"import": "./dist/runtime/index.mjs",
|
|
20
|
+
"require": "./dist/runtime/index.cjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"build:lib": "rollup -c",
|
|
26
|
+
"build:bin": "rollup -c rollup.cli.config.js",
|
|
27
|
+
"build": "npm run clean && npm run build:lib && npm run build:bin",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"dev": "rollup -c --watch",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"publish:check": "npm run build && npm run typecheck && npm test && npm pack --dry-run",
|
|
33
|
+
"prepublishOnly": "npm run publish:check"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE"
|
|
39
|
+
],
|
|
40
|
+
"keywords": [
|
|
41
|
+
"frontend",
|
|
42
|
+
"framework",
|
|
43
|
+
"jquery",
|
|
44
|
+
"blueprints",
|
|
45
|
+
"reactive",
|
|
46
|
+
"no-vdom",
|
|
47
|
+
"components",
|
|
48
|
+
"tardis",
|
|
49
|
+
"doctor-who"
|
|
50
|
+
],
|
|
51
|
+
"author": "devansharora18",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@rollup/plugin-typescript": "^11.0.0",
|
|
55
|
+
"@types/ws": "^8.18.1",
|
|
56
|
+
"jsdom": "^29.0.1",
|
|
57
|
+
"rollup": "^4.0.0",
|
|
58
|
+
"tslib": "^2.0.0",
|
|
59
|
+
"typescript": "^5.0.0",
|
|
60
|
+
"vitest": "^1.0.0",
|
|
61
|
+
"ws": "^8.20.0"
|
|
62
|
+
},
|
|
63
|
+
"dependencies": {
|
|
64
|
+
"chokidar": "^3.0.0",
|
|
65
|
+
"commander": "^12.0.0"
|
|
66
|
+
}
|
|
67
|
+
}
|