@tarve/core 0.5.0 → 0.6.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.
Files changed (109) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +54 -2
  3. package/dist/npm/build.js +714 -138
  4. package/dist/npm/cli.js +1013 -161
  5. package/dist/npm/embedded-assets.js +7 -2
  6. package/dist/npm/index.js +3096 -1084
  7. package/dist/npm/jsx-dev-runtime.js +1268 -0
  8. package/dist/npm/jsx-runtime.js +1268 -0
  9. package/dist/npm/native-runtime.json +3 -3
  10. package/dist/npm/node-build.js +299 -5
  11. package/dist/npm/protocol.js +1 -1
  12. package/dist/npm/txiki/fetch.ts +228 -0
  13. package/dist/npm/txiki/intl-data.ts +7 -0
  14. package/dist/npm/txiki/intl.test.ts +53 -0
  15. package/dist/npm/txiki/intl.ts +249 -0
  16. package/dist/npm/txiki/prelude.ts +132 -0
  17. package/dist/npm/txiki/runtime.ts +6 -0
  18. package/dist/npm/txiki/shims/buffer.ts +112 -0
  19. package/dist/npm/txiki/shims/child-process.ts +151 -0
  20. package/dist/npm/txiki/shims/crypto.ts +30 -0
  21. package/dist/npm/txiki/shims/events.ts +75 -0
  22. package/dist/npm/txiki/shims/fs-promises.ts +77 -0
  23. package/dist/npm/txiki/shims/fs.ts +231 -0
  24. package/dist/npm/txiki/shims/module.ts +8 -0
  25. package/dist/npm/txiki/shims/net.ts +69 -0
  26. package/dist/npm/txiki/shims/os.ts +72 -0
  27. package/dist/npm/txiki/shims/path.ts +4 -0
  28. package/dist/npm/txiki/shims/timers-promises.ts +9 -0
  29. package/dist/npm/txiki/shims/zlib.ts +9 -0
  30. package/dist/npm/txiki/tjs.d.ts +58 -0
  31. package/dist/npm/txiki/unavailable.ts +10 -0
  32. package/dist/types/core/build.d.ts +5 -2
  33. package/dist/types/core/jsx-compile.d.ts +7 -0
  34. package/dist/types/core/src/advanced-controls.d.ts +1 -1
  35. package/dist/types/core/src/app/element-events.d.ts +18 -0
  36. package/dist/types/core/src/app/media.d.ts +15 -0
  37. package/dist/types/core/src/app/requests.d.ts +25 -0
  38. package/dist/types/core/src/app/shadow.d.ts +7 -0
  39. package/dist/types/core/src/app/stats.d.ts +12 -0
  40. package/dist/types/core/src/app/tray.d.ts +40 -0
  41. package/dist/types/core/src/app-metadata.d.ts +2 -0
  42. package/dist/types/core/src/app.d.ts +29 -27
  43. package/dist/types/core/src/bridge/index.d.ts +1 -1
  44. package/dist/types/core/src/chat-controls.d.ts +2 -1
  45. package/dist/types/core/src/components/button.d.ts +1 -1
  46. package/dist/types/core/src/components/glass.d.ts +52 -0
  47. package/dist/types/core/src/components/icon.d.ts +1 -1
  48. package/dist/types/core/src/components/image.d.ts +1 -1
  49. package/dist/types/core/src/components/layout.d.ts +1 -1
  50. package/dist/types/core/src/components/pressable.d.ts +1 -1
  51. package/dist/types/core/src/components/rich-content.d.ts +1 -1
  52. package/dist/types/core/src/components/scroll.d.ts +2 -2
  53. package/dist/types/core/src/components/svg.d.ts +1 -1
  54. package/dist/types/core/src/components/titlebar.d.ts +15 -1
  55. package/dist/types/core/src/components/window.d.ts +21 -1
  56. package/dist/types/core/src/components.d.ts +2 -0
  57. package/dist/types/core/src/css-shadow.d.ts +1 -1
  58. package/dist/types/core/src/desktop-controls.d.ts +2 -2
  59. package/dist/types/core/src/embedded-assets.d.ts +3 -2
  60. package/dist/types/core/src/extra-controls.d.ts +1 -1
  61. package/dist/types/core/src/form-controls.d.ts +1 -1
  62. package/dist/types/core/src/index.d.ts +20 -11
  63. package/dist/types/core/src/inline-text.d.ts +7 -3
  64. package/dist/types/core/src/intrinsic-style.d.ts +1 -1
  65. package/dist/types/core/src/jsx-runtime.d.ts +10 -4
  66. package/dist/types/core/src/media-element.d.ts +3 -4
  67. package/dist/types/core/src/memo.d.ts +10 -0
  68. package/dist/types/core/src/motion.d.ts +1 -1
  69. package/dist/types/core/src/popups.d.ts +1 -1
  70. package/dist/types/core/src/protocol.d.ts +6 -0
  71. package/dist/types/core/src/reconciler/diff.d.ts +11 -0
  72. package/dist/types/core/src/reconciler/intrinsics.d.ts +24 -0
  73. package/dist/types/core/src/reconciler.d.ts +10 -11
  74. package/dist/types/core/src/render-scope.d.ts +8 -0
  75. package/dist/types/core/src/style.d.ts +1 -1
  76. package/dist/types/core/src/tailwind-palette.d.ts +1 -0
  77. package/dist/types/core/src/tailwind.d.ts +8 -0
  78. package/dist/types/core/src/test-renderer.d.ts +1 -1
  79. package/dist/types/core/src/text-search.d.ts +1 -1
  80. package/dist/types/core/src/theme.d.ts +8 -1
  81. package/dist/types/core/src/updates.d.ts +87 -0
  82. package/dist/types/core/src/virtual-list.d.ts +3 -1
  83. package/dist/types/core/txiki/fetch.d.ts +1 -0
  84. package/dist/types/core/txiki/intl-data.d.ts +6 -0
  85. package/dist/types/core/txiki/intl.d.ts +92 -0
  86. package/dist/types/core/txiki/prelude.d.ts +1 -0
  87. package/dist/types/core/txiki/runtime.d.ts +2 -0
  88. package/dist/types/core/txiki/shims/buffer.d.ts +37 -0
  89. package/dist/types/core/txiki/shims/child-process.d.ts +46 -0
  90. package/dist/types/core/txiki/shims/crypto.d.ts +16 -0
  91. package/dist/types/core/txiki/shims/events.d.ts +21 -0
  92. package/dist/types/core/txiki/shims/fs-promises.d.ts +41 -0
  93. package/dist/types/core/txiki/shims/fs.d.ts +44 -0
  94. package/dist/types/core/txiki/shims/module.d.ts +5 -0
  95. package/dist/types/core/txiki/shims/net.d.ts +22 -0
  96. package/dist/types/core/txiki/shims/os.d.ts +52 -0
  97. package/dist/types/core/txiki/shims/path.d.ts +3 -0
  98. package/dist/types/core/txiki/shims/timers-promises.d.ts +7 -0
  99. package/dist/types/core/txiki/shims/zlib.d.ts +11 -0
  100. package/dist/types/core/txiki/unavailable.d.ts +5 -0
  101. package/dist/types/core/txiki-build.d.ts +23 -0
  102. package/dist/types/core/updates-build.d.ts +35 -0
  103. package/dist/types/protocol/src/index.d.ts +159 -8
  104. package/native/linux-x64/libtarve_native.so +0 -0
  105. package/native/linux-x64/runtime.json +4 -4
  106. package/native/win32-x64/runtime.json +4 -4
  107. package/native/win32-x64/tarve_native.dll +0 -0
  108. package/package.json +3 -2
  109. /package/dist/types/core/{app-metadata.d.ts → package-metadata.d.ts} +0 -0
@@ -0,0 +1,92 @@
1
+ interface NumberOptions {
2
+ style?: "decimal" | "percent" | "unit" | "currency";
3
+ minimumFractionDigits?: number;
4
+ maximumFractionDigits?: number;
5
+ useGrouping?: boolean;
6
+ unit?: string;
7
+ currency?: string;
8
+ }
9
+ declare class NumberFormat {
10
+ private readonly options;
11
+ private readonly locale;
12
+ private readonly data;
13
+ constructor(locales?: string | string[], options?: NumberOptions);
14
+ format(input: number | bigint): string;
15
+ formatToParts(input: number | bigint): {
16
+ type: string;
17
+ value: string;
18
+ }[];
19
+ resolvedOptions(): {
20
+ style?: "decimal" | "percent" | "unit" | "currency";
21
+ minimumFractionDigits?: number;
22
+ maximumFractionDigits?: number;
23
+ useGrouping?: boolean;
24
+ unit?: string;
25
+ currency?: string;
26
+ locale: string;
27
+ numberingSystem: string;
28
+ };
29
+ static supportedLocalesOf(locales: string | string[]): string[];
30
+ }
31
+ type Width = "numeric" | "2-digit" | "short" | "long" | "narrow";
32
+ interface DateTimeOptions {
33
+ weekday?: Width;
34
+ era?: Width;
35
+ year?: Width;
36
+ month?: Width;
37
+ day?: Width;
38
+ hour?: Width;
39
+ minute?: Width;
40
+ second?: Width;
41
+ hour12?: boolean;
42
+ timeZone?: string;
43
+ dateStyle?: "full" | "long" | "medium" | "short";
44
+ timeStyle?: "full" | "long" | "medium" | "short";
45
+ }
46
+ declare class DateTimeFormat {
47
+ private readonly locale;
48
+ private readonly options;
49
+ private readonly entry;
50
+ constructor(locales?: string | string[], options?: DateTimeOptions);
51
+ format(value?: Date | number): string;
52
+ /** en-US composition for option sets intl-data.ts does not carry. */
53
+ private fallback;
54
+ formatToParts(value?: Date | number): {
55
+ type: string;
56
+ value: string;
57
+ }[];
58
+ resolvedOptions(): {
59
+ weekday?: Width;
60
+ era?: Width;
61
+ year?: Width;
62
+ month?: Width;
63
+ day?: Width;
64
+ hour?: Width;
65
+ minute?: Width;
66
+ second?: Width;
67
+ hour12?: boolean;
68
+ dateStyle?: "full" | "long" | "medium" | "short";
69
+ timeStyle?: "full" | "long" | "medium" | "short";
70
+ locale: string;
71
+ calendar: string;
72
+ numberingSystem: string;
73
+ timeZone: string;
74
+ };
75
+ static supportedLocalesOf(locales: string | string[]): string[];
76
+ }
77
+ declare class Collator {
78
+ private readonly options;
79
+ constructor(_locales?: string | string[], options?: {
80
+ numeric?: boolean;
81
+ sensitivity?: string;
82
+ });
83
+ compare: (left: string, right: string) => number;
84
+ }
85
+ export declare function installIntl(): void;
86
+ /** For tests: the shim's classes, without installing them. */
87
+ export declare const txikiIntl: {
88
+ DateTimeFormat: typeof DateTimeFormat;
89
+ NumberFormat: typeof NumberFormat;
90
+ Collator: typeof Collator;
91
+ };
92
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ /** #tarve/runtime in a txiki.js executable: the prelude extracted the native library. */
2
+ export declare function nativePath(): string;
@@ -0,0 +1,37 @@
1
+ /** The part of Node's Buffer the Tarve core uses, over Uint8Array. */
2
+ type Encoding = "utf8" | "utf-8" | "base64" | "hex" | "latin1" | "binary" | "ascii";
3
+ declare class BufferBytes extends Uint8Array {
4
+ static fromValue(value: string | ArrayBufferLike | ArrayLike<number> | ArrayBufferView, encodingOrOffset?: Encoding | number, length?: number): BufferBytes;
5
+ static alloc(size: number, fill?: number): BufferBytes;
6
+ static concat(list: readonly Uint8Array[], totalLength?: number): BufferBytes;
7
+ static isBuffer(value: unknown): value is BufferBytes;
8
+ static byteLength(value: string | ArrayBufferView | ArrayBuffer, encoding?: Encoding): number;
9
+ private static wrap;
10
+ toString(encoding?: Encoding, start?: number, end?: number): string;
11
+ write(value: string, offset?: number, encoding?: Encoding): number;
12
+ private view;
13
+ writeUInt8(value: number, offset?: number): number;
14
+ writeUInt16LE(value: number, offset?: number): number;
15
+ writeUInt16BE(value: number, offset?: number): number;
16
+ writeUInt32LE(value: number, offset?: number): number;
17
+ writeUInt32BE(value: number, offset?: number): number;
18
+ writeInt32LE(value: number, offset?: number): number;
19
+ writeInt32BE(value: number, offset?: number): number;
20
+ readUInt8(offset?: number): number;
21
+ readUInt16LE(offset?: number): number;
22
+ readUInt16BE(offset?: number): number;
23
+ readUInt32LE(offset?: number): number;
24
+ readUInt32BE(offset?: number): number;
25
+ readInt32LE(offset?: number): number;
26
+ readInt32BE(offset?: number): number;
27
+ }
28
+ /** Node's Buffer: `Buffer.from` takes encodings and offsets, unlike Uint8Array.from. */
29
+ type BufferConstructor = Omit<typeof BufferBytes, "from" | "prototype"> & {
30
+ from: typeof BufferBytes.fromValue;
31
+ prototype: BufferBytes;
32
+ new (length: number): BufferBytes;
33
+ new (buffer: ArrayBuffer, byteOffset?: number, length?: number): BufferBytes;
34
+ };
35
+ export declare const Buffer: BufferConstructor;
36
+ export type Buffer = BufferBytes;
37
+ export {};
@@ -0,0 +1,46 @@
1
+ /** node:child_process spawn over tjs.spawn: exit/error events and stream-like stdio. */
2
+ import { Buffer } from "./buffer";
3
+ import { EventEmitter } from "./events";
4
+ type Stdio = "pipe" | "ignore" | "inherit";
5
+ export interface SpawnOptions {
6
+ cwd?: string;
7
+ env?: Record<string, string | undefined>;
8
+ stdio?: Stdio | Stdio[];
9
+ windowsHide?: boolean;
10
+ }
11
+ /** A Node-style readable over a web stream: "data"/"end" events or async iteration. */
12
+ declare class Readable extends EventEmitter {
13
+ private readonly stream;
14
+ private encoding?;
15
+ private started;
16
+ constructor(stream: ReadableStream<Uint8Array>);
17
+ setEncoding(encoding: string): this;
18
+ private chunk;
19
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
20
+ private pump;
21
+ [Symbol.asyncIterator](): AsyncGenerator<Buffer | string>;
22
+ }
23
+ declare class Writable extends EventEmitter {
24
+ private readonly writer;
25
+ constructor(stream: WritableStream<Uint8Array>);
26
+ write(data: string | Uint8Array, callback?: (error?: Error) => void): boolean;
27
+ end(data?: string | Uint8Array): this;
28
+ }
29
+ export declare class ChildProcess extends EventEmitter {
30
+ pid?: number;
31
+ exitCode: number | null;
32
+ signalCode: string | null;
33
+ killed: boolean;
34
+ stdin: Writable | null;
35
+ stdout: Readable | null;
36
+ stderr: Readable | null;
37
+ private process?;
38
+ constructor(command: string, args: readonly string[], options?: SpawnOptions);
39
+ kill(signal?: string): boolean;
40
+ }
41
+ export declare function spawn(command: string, args?: readonly string[] | SpawnOptions, options?: SpawnOptions): ChildProcess;
42
+ declare const _default: {
43
+ ChildProcess: typeof ChildProcess;
44
+ spawn: typeof spawn;
45
+ };
46
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { Buffer } from "./buffer";
2
+ export declare function createHash(algorithm: string): {
3
+ update(data: string | Uint8Array): {
4
+ update(data: string | Uint8Array): /*elided*/ any;
5
+ digest(encoding?: "hex" | "base64"): any;
6
+ };
7
+ digest(encoding?: "hex" | "base64"): any;
8
+ };
9
+ export declare function randomUUID(): string;
10
+ export declare function randomBytes(size: number): Buffer;
11
+ declare const _default: {
12
+ createHash: typeof createHash;
13
+ randomBytes: typeof randomBytes;
14
+ randomUUID: typeof randomUUID;
15
+ };
16
+ export default _default;
@@ -0,0 +1,21 @@
1
+ /** node:events: the EventEmitter subset apps and the shims use. */
2
+ type Listener = (...args: any[]) => void;
3
+ export declare class EventEmitter {
4
+ private readonly events;
5
+ on(event: string | symbol, listener: Listener): this;
6
+ addListener(event: string | symbol, listener: Listener): this;
7
+ once(event: string | symbol, listener: Listener): this;
8
+ off(event: string | symbol, listener: Listener): this;
9
+ removeListener(event: string | symbol, listener: Listener): this;
10
+ removeAllListeners(event?: string | symbol): this;
11
+ emit(event: string | symbol, ...args: unknown[]): boolean;
12
+ listenerCount(event: string | symbol): number;
13
+ setMaxListeners(_count: number): this;
14
+ }
15
+ /** Resolves with the event's arguments; rejects on "error" (except when waiting for "error"). */
16
+ export declare function once(emitter: EventEmitter, event: string): Promise<unknown[]>;
17
+ declare const _default: typeof EventEmitter & {
18
+ EventEmitter: typeof EventEmitter;
19
+ once: typeof once;
20
+ };
21
+ export default _default;
@@ -0,0 +1,41 @@
1
+ type Encoding = BufferEncoding | {
2
+ encoding?: BufferEncoding | null;
3
+ } | null | undefined;
4
+ export declare function readFile(path: string, options?: Encoding): Promise<any>;
5
+ export declare function writeFile(path: string, data: string | Uint8Array): Promise<void>;
6
+ export declare function mkdir(path: string, options?: {
7
+ recursive?: boolean;
8
+ }): Promise<void>;
9
+ export declare function mkdtemp(prefix: string): Promise<string>;
10
+ export declare function rm(path: string, options?: {
11
+ force?: boolean;
12
+ recursive?: boolean;
13
+ }): Promise<void>;
14
+ export declare const unlink: (path: string) => Promise<void>;
15
+ export declare const rename: (from: string, to: string) => Promise<void>;
16
+ export declare const copyFile: (from: string, to: string) => Promise<void>;
17
+ export declare function stat(path: string): Promise<{
18
+ size: number;
19
+ mtimeMs: number;
20
+ mtime: Date;
21
+ isFile: () => boolean;
22
+ isDirectory: () => boolean;
23
+ }>;
24
+ export declare function access(path: string): Promise<void>;
25
+ export declare function readdir(path: string, options?: {
26
+ withFileTypes?: boolean;
27
+ }): Promise<any[]>;
28
+ declare const _default: {
29
+ access: typeof access;
30
+ copyFile: typeof copyFile;
31
+ mkdir: typeof mkdir;
32
+ mkdtemp: typeof mkdtemp;
33
+ readFile: typeof readFile;
34
+ readdir: typeof readdir;
35
+ rename: typeof rename;
36
+ rm: typeof rm;
37
+ stat: typeof stat;
38
+ unlink: typeof unlink;
39
+ writeFile: typeof writeFile;
40
+ };
41
+ export default _default;
@@ -0,0 +1,44 @@
1
+ type Encoding = BufferEncoding | {
2
+ encoding?: BufferEncoding | null;
3
+ flag?: string;
4
+ } | null | undefined;
5
+ export interface Stats {
6
+ size: number;
7
+ mtimeMs: number;
8
+ isFile(): boolean;
9
+ isDirectory(): boolean;
10
+ }
11
+ export declare function statSync(path: string, options?: {
12
+ throwIfNoEntry?: boolean;
13
+ }): Stats;
14
+ export declare function existsSync(path: string): boolean;
15
+ export declare function readFileSync(path: string, options?: Encoding): any;
16
+ export declare function writeFileSync(path: string, data: string | Uint8Array, options?: Encoding): void;
17
+ export declare function mkdirSync(path: string, options?: {
18
+ recursive?: boolean;
19
+ }): void;
20
+ export declare function renameSync(from: string, to: string): void;
21
+ export declare function rmSync(path: string, options?: {
22
+ force?: boolean;
23
+ recursive?: boolean;
24
+ }): void;
25
+ export declare function readdirSync(path: string, options?: {
26
+ withFileTypes?: boolean;
27
+ }): any[];
28
+ export declare function mkdtempSync(prefix: string): string;
29
+ export declare function chmodSync(path: string, mode: number): void;
30
+ export declare function unlinkSync(path: string): void;
31
+ declare const _default: {
32
+ chmodSync: typeof chmodSync;
33
+ existsSync: typeof existsSync;
34
+ mkdirSync: typeof mkdirSync;
35
+ mkdtempSync: typeof mkdtempSync;
36
+ readFileSync: typeof readFileSync;
37
+ readdirSync: typeof readdirSync;
38
+ renameSync: typeof renameSync;
39
+ rmSync: typeof rmSync;
40
+ statSync: typeof statSync;
41
+ unlinkSync: typeof unlinkSync;
42
+ writeFileSync: typeof writeFileSync;
43
+ };
44
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export declare function createRequire(_from: string | URL): (id: string) => unknown;
2
+ declare const _default: {
3
+ createRequire: typeof createRequire;
4
+ };
5
+ export default _default;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * node:net createConnection for the native event wake pipe (a Windows named pipe or a
3
+ * Unix socket), over tjs.connect("pipe"). Only the events the bridge listens to exist.
4
+ */
5
+ type Listener = (...args: any[]) => void;
6
+ export declare class Socket {
7
+ destroyed: boolean;
8
+ private readonly listeners;
9
+ private connection?;
10
+ constructor(path: string);
11
+ private pump;
12
+ private fail;
13
+ private emit;
14
+ on(event: string, listener: Listener): this;
15
+ destroy(): this;
16
+ }
17
+ export declare function createConnection(path: string): Socket;
18
+ declare const _default: {
19
+ Socket: typeof Socket;
20
+ createConnection: typeof createConnection;
21
+ };
22
+ export default _default;
@@ -0,0 +1,52 @@
1
+ export declare const EOL: string;
2
+ export declare function tmpdir(): string;
3
+ export declare function homedir(): string;
4
+ export declare function hostname(): string;
5
+ export declare function platform(): string;
6
+ export declare function type(): string;
7
+ export declare function arch(): string;
8
+ export declare function cpus(): {
9
+ model: string;
10
+ speed: number;
11
+ times: {
12
+ user: number;
13
+ nice: number;
14
+ sys: number;
15
+ idle: number;
16
+ irq: number;
17
+ };
18
+ }[];
19
+ export declare function availableParallelism(): number;
20
+ export declare function loadavg(): number[];
21
+ export declare function uptime(): number;
22
+ export declare function userInfo(): {
23
+ username: string;
24
+ uid: number;
25
+ gid: number;
26
+ shell: string | null;
27
+ homedir: string;
28
+ };
29
+ export declare function networkInterfaces(): Record<string, object[]>;
30
+ export declare function totalmem(): number;
31
+ export declare function freemem(): number;
32
+ /** Kernel version, e.g. "10.0.26100" on Windows (RtlGetVersion is not shimmed by compatibility modes). */
33
+ export declare function release(): string;
34
+ declare const _default: {
35
+ EOL: string;
36
+ arch: typeof arch;
37
+ availableParallelism: typeof availableParallelism;
38
+ cpus: typeof cpus;
39
+ freemem: typeof freemem;
40
+ homedir: typeof homedir;
41
+ hostname: typeof hostname;
42
+ loadavg: typeof loadavg;
43
+ networkInterfaces: typeof networkInterfaces;
44
+ platform: typeof platform;
45
+ release: typeof release;
46
+ tmpdir: typeof tmpdir;
47
+ totalmem: typeof totalmem;
48
+ type: typeof type;
49
+ uptime: typeof uptime;
50
+ userInfo: typeof userInfo;
51
+ };
52
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import path from "tjs:path";
2
+ export declare const basename: typeof import("node:path").basename, delimiter: ":" | ";", dirname: typeof import("node:path").dirname, extname: typeof import("node:path").extname, format: typeof import("node:path").format, isAbsolute: typeof import("node:path").isAbsolute, join: typeof import("node:path").join, normalize: typeof import("node:path").normalize, parse: typeof import("node:path").parse, posix: typeof import("node:path"), relative: typeof import("node:path").relative, resolve: typeof import("node:path").resolve, sep: "/" | "\\", toNamespacedPath: typeof import("node:path").toNamespacedPath, win32: typeof import("node:path");
3
+ export default path;
@@ -0,0 +1,7 @@
1
+ export declare function setTimeout<T = void>(milliseconds?: number, value?: T): Promise<T>;
2
+ export declare function setImmediate<T = void>(value?: T): Promise<T>;
3
+ declare const _default: {
4
+ setImmediate: typeof setImmediate;
5
+ setTimeout: typeof setTimeout;
6
+ };
7
+ export default _default;
@@ -0,0 +1,11 @@
1
+ export declare const deflateSync: (_data: Uint8Array) => Uint8Array;
2
+ export declare const inflateSync: (_data: Uint8Array) => Uint8Array;
3
+ export declare const gzipSync: (_data: Uint8Array) => Uint8Array;
4
+ export declare const gunzipSync: (_data: Uint8Array) => Uint8Array;
5
+ declare const _default: {
6
+ deflateSync: typeof deflateSync;
7
+ gunzipSync: typeof gunzipSync;
8
+ gzipSync: typeof gzipSync;
9
+ inflateSync: typeof inflateSync;
10
+ };
11
+ export default _default;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Stands in for a Node API txiki.js lacks. Each call site is a pure call that tree
3
+ * shaking removes when the API is unused; txiki-build rejects a bundle where one is left.
4
+ */
5
+ export declare function unavailable(marker: string): any;
@@ -0,0 +1,23 @@
1
+ import { type BuildOptions } from "./build";
2
+ export interface TxikiBuildOptions extends BuildOptions {
3
+ /** txiki.js (tjs) used to compile the bundle. Defaults to TARVE_TXIKI, then `tjs` on PATH. */
4
+ txikiExecutable?: string;
5
+ }
6
+ interface EmbeddedFile {
7
+ name: string;
8
+ data: Uint8Array;
9
+ gzip: boolean;
10
+ }
11
+ /**
12
+ * Bundle a TSX app for txiki.js (QuickJS-ng + libuv) and fuse it, with the native
13
+ * runtime and assets, into one executable: no Bun or Node.js at run time.
14
+ *
15
+ * Layout: [txiki.js][files][index JSON][u32 index length][u32 0]["TARVEBLB"][tjs payload]["tx1k1.js"][u32 payload offset]
16
+ */
17
+ export declare function buildTxiki(options: TxikiBuildOptions): Promise<string>;
18
+ /** Fails the build when a placeholder for a missing Node API survived tree shaking: the app would throw at run time. */
19
+ export declare function assertAvailable(bundle: string, importers?: ReadonlyMap<string, ReadonlySet<string>>): void;
20
+ /** The bytecode `tjs compile` appended to its own binary, without the trailer. */
21
+ export declare function txikiPayload(compiled: Uint8Array, hostSize: number): Uint8Array;
22
+ export declare function fuse(executable: Uint8Array, files: readonly EmbeddedFile[], payload: Uint8Array): Uint8Array;
23
+ export {};
@@ -0,0 +1,35 @@
1
+ import { type SignedUpdateManifest, type UpdateManifest } from "./src/updates";
2
+ export interface UpdateKeys {
3
+ /** Base64 raw Ed25519 public key: pass to checkForUpdate. */
4
+ publicKey: string;
5
+ /** Base64 PKCS#8 private key: keep secret, give to tarve release. */
6
+ privateKey: string;
7
+ }
8
+ export declare function generateUpdateKeys(): UpdateKeys;
9
+ /** The base64 public key that belongs to `privateKey`. */
10
+ export declare function updatePublicKey(privateKey: string): string;
11
+ export declare function signUpdateManifest(manifest: UpdateManifest, privateKey: string): SignedUpdateManifest;
12
+ export interface ReleaseOptions {
13
+ version: string;
14
+ /** `platform=path` pairs, e.g. `win32-x64=dist/App.exe`. */
15
+ artifacts: string[];
16
+ /** Base64 PKCS#8 key, or a path to a file holding it. */
17
+ privateKey: string;
18
+ /** Public key the app ships with: release fails when the private key does not match it. */
19
+ publicKey?: string;
20
+ outDir?: string;
21
+ /** Prefix for artifact URLs; relative to the manifest URL when omitted. */
22
+ baseUrl?: string;
23
+ name?: string;
24
+ notes?: string;
25
+ /**
26
+ * Authenticode command run on each Windows artifact (the copy in `outDir`) before it is hashed, e.g.
27
+ * `signtool sign /fd sha256 /tr http://timestamp.digicert.com /td sha256 {file}`. `{file}` is the quoted
28
+ * path; without it the path is appended.
29
+ */
30
+ sign?: string;
31
+ }
32
+ /** Runs `command` on `file` through the shell (see ReleaseOptions.sign); throws when it fails. */
33
+ export declare function signFile(command: string, file: string): void;
34
+ /** Copies the artifacts into `outDir` and writes the signed `latest.json` beside them. */
35
+ export declare function release(options: ReleaseOptions): string;