preserves/implementations/javascript/packages/core/src/index.ts

25 lines
608 B
TypeScript
Raw Permalink Normal View History

export * from './runtime';
export * as Constants from './constants';
export * as Pexpr from './pexpr';
2021-03-09 14:59:40 +00:00
2024-03-12 16:47:38 +00:00
import type { Embeddable } from './embedded';
import type { Value } from './values';
declare global {
interface ArrayConstructor {
2024-03-12 16:47:38 +00:00
__from_preserve__<T extends Embeddable>(v: Value<T>): undefined | Array<Value<T>>;
}
}
2024-03-12 16:47:38 +00:00
Array.__from_preserve__ = <T extends Embeddable>(v: Value<T>) => {
return Array.isArray(v) ? v : void 0;
};
2021-03-09 14:59:40 +00:00
const _Array = Array;
type _Array<T> = Array<T>;
export { _Array as Array };
const _Symbol = Symbol;
type _Symbol = Symbol;
export { _Symbol as Symbol };