@holoscript/std 3.1.1 → 6.0.3
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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/dist/__tests__/EconomicPrimitives.test.d.ts +2 -0
- package/dist/__tests__/EconomicTraits.test.d.ts +2 -0
- package/dist/__tests__/SimulationLabPrimitives.test.d.ts +2 -0
- package/dist/__tests__/collections.test.d.ts +2 -0
- package/dist/__tests__/events.test.d.ts +2 -0
- package/dist/__tests__/index.test.d.ts +2 -0
- package/dist/__tests__/index.test.d.ts.map +1 -0
- package/dist/__tests__/materials.test.d.ts +2 -0
- package/dist/__tests__/math.test.d.ts +2 -0
- package/dist/__tests__/physics.test.d.ts +2 -0
- package/dist/__tests__/spatial.test.d.ts +2 -0
- package/dist/__tests__/standard-library-fundamentals.test.d.ts +2 -0
- package/dist/__tests__/standard-library-fundamentals.test.d.ts.map +1 -0
- package/dist/__tests__/string-and-time-utilities.test.d.ts +2 -0
- package/dist/__tests__/string-and-time-utilities.test.d.ts.map +1 -0
- package/dist/__tests__/string-decoupled.test.d.ts +2 -0
- package/dist/__tests__/string.test.d.ts +2 -0
- package/dist/__tests__/time.test.d.ts +2 -0
- package/dist/chunk-7HVUYGPS.js +679 -0
- package/dist/chunk-7HVUYGPS.js.map +1 -0
- package/dist/chunk-P4O3WNG2.js +287 -0
- package/dist/chunk-P4O3WNG2.js.map +1 -0
- package/dist/chunk-PFX2JM4X.js +683 -0
- package/dist/chunk-PFX2JM4X.js.map +1 -0
- package/dist/chunk-W2Q3LUCM.js +348 -0
- package/dist/chunk-W2Q3LUCM.js.map +1 -0
- package/dist/chunk-WS6W35YC.js +443 -0
- package/dist/chunk-WS6W35YC.js.map +1 -0
- package/dist/chunk-ZXVZAQCZ.js +470 -0
- package/dist/chunk-ZXVZAQCZ.js.map +1 -0
- package/dist/collections.cjs +715 -0
- package/dist/collections.cjs.map +1 -0
- package/dist/collections.d.ts +177 -0
- package/dist/collections.js +17 -0
- package/dist/collections.js.map +1 -0
- package/dist/events.d.ts +32 -0
- package/dist/index.cjs +4101 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +1270 -190
- package/dist/index.js.map +1 -0
- package/dist/materials.d.ts +50 -0
- package/dist/math.cjs +591 -0
- package/dist/math.cjs.map +1 -0
- package/dist/math.d.ts +162 -0
- package/dist/math.js +53 -0
- package/dist/math.js.map +1 -0
- package/dist/physics.d.ts +59 -0
- package/dist/spatial.d.ts +82 -0
- package/dist/string.basic.test.d.ts +5 -0
- package/dist/string.basic.test.d.ts.map +1 -0
- package/dist/string.cjs +422 -0
- package/dist/string.cjs.map +1 -0
- package/dist/string.d.ts +212 -0
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +107 -0
- package/dist/string.js.map +1 -0
- package/dist/string.test.d.ts +5 -0
- package/dist/string.test.d.ts.map +1 -0
- package/dist/time.cjs +512 -0
- package/dist/time.cjs.map +1 -0
- package/dist/time.d.ts +215 -0
- package/dist/time.js +43 -0
- package/dist/time.js.map +1 -0
- package/dist/traits/ARTraits.d.ts +14 -0
- package/dist/traits/EconomicPrimitives.cjs +335 -0
- package/dist/traits/EconomicPrimitives.cjs.map +1 -0
- package/dist/traits/EconomicPrimitives.d.ts +345 -0
- package/dist/traits/EconomicPrimitives.js +55 -0
- package/dist/traits/EconomicPrimitives.js.map +1 -0
- package/dist/traits/EconomicTraits.cjs +471 -0
- package/dist/traits/EconomicTraits.cjs.map +1 -0
- package/dist/traits/EconomicTraits.d.ts +71 -0
- package/dist/traits/EconomicTraits.js +17 -0
- package/dist/traits/EconomicTraits.js.map +1 -0
- package/dist/traits/IoTTraits.d.ts +14 -0
- package/dist/traits/SimulationLabPrimitives.d.ts +187 -0
- package/dist/traits/SimulationLabTraits.d.ts +42 -0
- package/dist/traits/VRRTraits.d.ts +150 -0
- package/dist/traits/__tests__/ARTraits.test.d.ts +2 -0
- package/dist/traits/__tests__/ARTraits.test.d.ts.map +1 -0
- package/dist/traits/__tests__/EconomicPrimitives.test.d.ts +2 -0
- package/dist/traits/__tests__/EconomicPrimitives.test.d.ts.map +1 -0
- package/dist/traits/__tests__/EconomicTraits.test.d.ts +2 -0
- package/dist/traits/__tests__/EconomicTraits.test.d.ts.map +1 -0
- package/dist/types.d.ts +202 -0
- package/error-utf8.log +6 -0
- package/error.log +0 -0
- package/package.json +30 -18
- package/src/__tests__/index.test.ts +14 -0
- package/src/__tests__/{Sprint33.test.ts → standard-library-fundamentals.test.ts} +70 -70
- package/src/__tests__/{Sprint56.test.ts → string-and-time-utilities.test.ts} +64 -64
- package/src/__tests__/string-decoupled.test.ts +0 -2
- package/src/string.basic.test.ts +1 -1
- package/src/string.test.ts +4 -4
- package/src/string.ts +30 -15
- package/src/time.ts +1 -1
- package/src/traits/__tests__/ARTraits.test.ts +14 -0
- package/src/traits/__tests__/EconomicPrimitives.test.ts +14 -0
- package/src/traits/__tests__/EconomicTraits.test.ts +14 -0
- package/std_error.log +5 -0
- package/tsup.config.ts +17 -0
- package/dist/__tests__/Sprint33.test.d.ts.map +0 -1
- package/dist/__tests__/Sprint56.test.d.ts.map +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @holoscript/std - Standard Library for HoloScript Plus
|
|
3
|
+
*
|
|
4
|
+
* Provides core types, math utilities, collections, string operations,
|
|
5
|
+
* time management, spatial math, physics primitives, materials, and events
|
|
6
|
+
* for HoloScript Plus programs.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```hsplus
|
|
10
|
+
* import { Vec3, createPBRMaterial, EventBus } from "@holoscript/std";
|
|
11
|
+
*
|
|
12
|
+
* let position = Vec3(0, 1, 0);
|
|
13
|
+
* let steel = createPBRMaterial("Steel", "metal");
|
|
14
|
+
* let bus = new EventBus();
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export * from './types.js';
|
|
18
|
+
export { Vec3, Quaternion, Transform, Ray, AABB, distance, lerp as spatialLerp, clamp as spatialClamp, degToRad as spatialDegToRad, radToDeg as spatialRadToDeg, } from './spatial.js';
|
|
19
|
+
export { createBoxCollider, createSphereCollider, createCapsuleCollider, createRigidbody, } from './physics.js';
|
|
20
|
+
export type { ColliderConfig, ColliderShapeType, RigidbodyConfig, ForceFieldConfig, ForceFieldType, JointConfig, JointType, RaycastHit, } from './physics.js';
|
|
21
|
+
export { MATERIAL_PRESETS, createPBRMaterial } from './materials.js';
|
|
22
|
+
export type { PBRMaterial, UnlitMaterial, TextureMapType, TextureConfig } from './materials.js';
|
|
23
|
+
export { EventBus } from './events.js';
|
|
24
|
+
export type { EventHandler } from './events.js';
|
|
25
|
+
export { PI, TAU, HALF_PI, EPSILON, DEG_TO_RAD, RAD_TO_DEG, clamp, lerp, inverseLerp, remap, smoothstep, smootherstep, sign, fract, mod, step, degToRad, radToDeg, vec2Math, vec3Math, quatMath, aabbMath, noise, random, } from './math.js';
|
|
26
|
+
export { degToRad as toRadians, radToDeg as toDegrees } from './math.js';
|
|
27
|
+
export { List, HoloMap, HoloSet, HoloMap as Map, HoloSet as Set, SpatialGrid, PriorityQueue, } from './collections.js';
|
|
28
|
+
export { isBlank, isNotBlank, capitalize, titleCase, camelCase, pascalCase, snakeCase, kebabCase, constantCase, padLeft, padRight, center, truncate, truncateMiddle, repeat, reverse, count, containsIgnoreCase, startsWithIgnoreCase, endsWithIgnoreCase, removeWhitespace, collapseWhitespace, removePrefix, removeSuffix, wrap as wrapString, unwrap, lines, words, chars, join, format, formatNumber, numberWithCommas, formatBytes, formatDuration, escapeHtml, unescapeHtml, escapeRegex, slugify, isValidIdentifier, isNumeric, isAlphanumeric, isAlpha, randomString, uuid, indent, dedent, wordWrap, levenshtein, similarity, extractTraits, } from './string.js';
|
|
29
|
+
export { generateTxHash, executeTrade, calculateDepreciation, depreciatedValue, isDestroyed, calculateRepairCost, DEFAULT_DEPRECIATION, bondingCurvePrice, bondingCurveBuyCost, bondingCurveSellRefund, spatialPrice, DEFAULT_BONDING_CURVE, calculateTaxRate, calculateTaxAmount, calculateRedistribution, DEFAULT_WEALTH_TAX, createPIDState, updatePID, createDualLoopPIDState, updateDualLoopPID, DEFAULT_PID, createFaucetSinkMetrics, recordFaucet, recordSink, resetMetricsPeriod, } from './traits/EconomicPrimitives.js';
|
|
30
|
+
export type { Currency, AgentID, EconomicResult, EconomicError, EconomicPermission, OwnershipRecord, TransferRecord, DepreciationConfig, BondingCurveType, BondingCurveConfig, WealthTaxConfig, PIDConfig, PIDState, DualLoopPIDConfig, DualLoopPIDState, FaucetSinkMetrics, } from './traits/EconomicPrimitives.js';
|
|
31
|
+
export { EconomicTraits, getEconomicTraitNames, getEconomicTrait, validateTraitComposition, getRequiredPermissions, } from './traits/EconomicTraits.js';
|
|
32
|
+
export type { EconomicTraitDefinition } from './traits/EconomicTraits.js';
|
|
33
|
+
export { mean, variance, standardDeviation, standardError, cohensD, tTest, oneSampleTTest, mannWhitneyU, chiSquaredTest, expandSweep, generateSweepCombinations, isParameterRange, extractMetric, groupByParameter, summarizeMetrics, } from './traits/SimulationLabPrimitives.js';
|
|
34
|
+
export type { Hypothesis, HypothesisDirection, SimulationStatus, ParameterRange, ParameterSet, ParameterSweep, SimulationMetrics, StatisticalResult, ExperimentResult, } from './traits/SimulationLabPrimitives.js';
|
|
35
|
+
export { SimulationLabTraits, getSimulationTraitNames, getSimulationTrait, } from './traits/SimulationLabTraits.js';
|
|
36
|
+
export type { SimulationTraitDefinition } from './traits/SimulationLabTraits.js';
|
|
37
|
+
export { now, hrTime, sleep, waitUntil, withTimeout, retry, debounce, throttle, measure, timed, Stopwatch, IntervalTimer, CountdownTimer, FrameTimer, schedule, scheduleInterval, scheduleFrame, createTicker, DateTime, } from './time.js';
|
|
38
|
+
/**
|
|
39
|
+
* Print to console (HoloScript standard output)
|
|
40
|
+
*/
|
|
41
|
+
export declare function print(...args: unknown[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* Print error to console
|
|
44
|
+
*/
|
|
45
|
+
export declare function printError(...args: unknown[]): void;
|
|
46
|
+
/**
|
|
47
|
+
* Print warning to console
|
|
48
|
+
*/
|
|
49
|
+
export declare function printWarn(...args: unknown[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Assert a condition is true
|
|
52
|
+
*/
|
|
53
|
+
export declare function assert(condition: boolean, message?: string): asserts condition;
|
|
54
|
+
/**
|
|
55
|
+
* Assert a value is not null or undefined
|
|
56
|
+
*/
|
|
57
|
+
export declare function assertDefined<T>(value: T | null | undefined, message?: string): asserts value is T;
|
|
58
|
+
/**
|
|
59
|
+
* Unreachable code marker (for exhaustiveness checking)
|
|
60
|
+
*/
|
|
61
|
+
export declare function unreachable(message?: string): never;
|
|
62
|
+
/**
|
|
63
|
+
* Todo marker (throws at runtime)
|
|
64
|
+
*/
|
|
65
|
+
export declare function todo(message?: string): never;
|
|
66
|
+
/**
|
|
67
|
+
* Deep clone an object
|
|
68
|
+
*/
|
|
69
|
+
export declare function clone<T>(value: T): T;
|
|
70
|
+
/**
|
|
71
|
+
* Deep equality check
|
|
72
|
+
*/
|
|
73
|
+
export declare function equals(a: unknown, b: unknown): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Pipe a value through a series of functions
|
|
76
|
+
*/
|
|
77
|
+
export declare function pipe<A>(value: A): A;
|
|
78
|
+
export declare function pipe<A, B>(value: A, fn1: (a: A) => B): B;
|
|
79
|
+
export declare function pipe<A, B, C>(value: A, fn1: (a: A) => B, fn2: (b: B) => C): C;
|
|
80
|
+
export declare function pipe<A, B, C, D>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D): D;
|
|
81
|
+
export declare function pipe<A, B, C, D, E>(value: A, fn1: (a: A) => B, fn2: (b: B) => C, fn3: (c: C) => D, fn4: (d: D) => E): E;
|
|
82
|
+
/**
|
|
83
|
+
* Compose functions right to left
|
|
84
|
+
*/
|
|
85
|
+
export declare function compose<A>(): (a: A) => A;
|
|
86
|
+
export declare function compose<A, B>(fn1: (a: A) => B): (a: A) => B;
|
|
87
|
+
export declare function compose<A, B, C>(fn2: (b: B) => C, fn1: (a: A) => B): (a: A) => C;
|
|
88
|
+
export declare function compose<A, B, C, D>(fn3: (c: C) => D, fn2: (b: B) => C, fn1: (a: A) => B): (a: A) => D;
|
|
89
|
+
/**
|
|
90
|
+
* Identity function
|
|
91
|
+
*/
|
|
92
|
+
export declare function identity<T>(value: T): T;
|
|
93
|
+
/**
|
|
94
|
+
* No-operation function
|
|
95
|
+
*/
|
|
96
|
+
export declare function noop(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Create a constant function
|
|
99
|
+
*/
|
|
100
|
+
export declare function constant<T>(value: T): () => T;
|
|
101
|
+
//# sourceMappingURL=index.d.ts.map
|