tjs-lang 0.8.3 → 0.8.4

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.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The CSS torture set — predicates for the exact cases where TS structural
3
+ * types and JSON Schema cave to `string`/`any`:
4
+ * - open value grammars: var(), calc(), !important
5
+ * - order-flexible shorthands: the `animation` family (tokenize + classify)
6
+ * - open recursive structure: nested selectors / keyframes (recurse)
7
+ *
8
+ * Written in named-composition style — no inline arrows, no IO, no async —
9
+ * so it reads as "synchronous AJS" and verifies predicate-safe. `||` composition
10
+ * and `.every(namedPredicate)` are natural here because predicates run as native
11
+ * JS (the verified fast path), not through the sandboxed VM interpreter.
12
+ */
13
+ export declare const CSS_PREDICATE_SOURCE: string;
@@ -0,0 +1,39 @@
1
+ export interface PredicateDiagnostic {
2
+ predicate: string;
3
+ message: string;
4
+ line: number;
5
+ column: number;
6
+ }
7
+ export interface VerifyResult {
8
+ safe: boolean;
9
+ predicates: string[];
10
+ diagnostics: PredicateDiagnostic[];
11
+ }
12
+ /**
13
+ * Build the effectful-name set from a VM atom registry: every atom tagged
14
+ * `effects: 'io'` (plus the non-atom globals). This is how the predicate
15
+ * verifier consumes the atom-effects classification.
16
+ */
17
+ export declare function effectfulFrom(atoms: Record<string, {
18
+ op?: string;
19
+ effects?: 'pure' | 'io';
20
+ }>): Set<string>;
21
+ /**
22
+ * Verify every top-level function in `source` is predicate-safe. Because safety
23
+ * is a closure property, the whole cluster is safe iff each function is — so the
24
+ * transitive check is automatic: a call to another function in the set is fine,
25
+ * a call to anything effectful/unknown is not.
26
+ */
27
+ export declare function verifyPredicates(source: string, opts?: {
28
+ effectful?: Set<string>;
29
+ }): VerifyResult;
30
+ /** Format diagnostics for a thrown error / log. */
31
+ export declare function formatDiagnostics(d: PredicateDiagnostic[]): string;
32
+ /**
33
+ * Verify, then compile the predicate cluster to native synchronous JS functions.
34
+ * Throws (with located diagnostics) at "definition time" if not predicate-safe —
35
+ * so an IO-using "predicate" never even compiles.
36
+ */
37
+ export declare function compilePredicates(source: string, exports: string[], opts?: {
38
+ effectful?: Set<string>;
39
+ }): Record<string, (...args: any[]) => any>;