brs-js 2.1.2 → 3.0.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.
- package/README.md +271 -190
- package/dist/dist.js +6 -1
- package/dist/dist.js.map +1 -1
- package/dist/dist.mjs +7393 -0
- package/dist/dist.mjs.map +1 -0
- package/dist/dist.node.js +6 -1
- package/dist/dist.node.js.map +1 -1
- package/dist/dist.web.js +6 -1
- package/dist/dist.web.js.map +1 -1
- package/dist/src/brdb/bits.d.ts +13 -0
- package/dist/src/brdb/bits.d.ts.map +1 -0
- package/dist/src/brdb/brdb.d.ts +131 -0
- package/dist/src/brdb/brdb.d.ts.map +1 -0
- package/dist/src/brdb/brz.d.ts +51 -0
- package/dist/src/brdb/brz.d.ts.map +1 -0
- package/dist/src/brdb/bytes.d.ts +56 -0
- package/dist/src/brdb/bytes.d.ts.map +1 -0
- package/dist/src/brdb/catalog.d.ts +5 -0
- package/dist/src/brdb/catalog.d.ts.map +1 -0
- package/dist/src/brdb/componentDb.d.ts +8 -0
- package/dist/src/brdb/componentDb.d.ts.map +1 -0
- package/dist/src/brdb/fs.d.ts +16 -0
- package/dist/src/brdb/fs.d.ts.map +1 -0
- package/dist/src/brdb/guid.d.ts +11 -0
- package/dist/src/brdb/guid.d.ts.map +1 -0
- package/dist/src/brdb/index.d.ts +21 -0
- package/dist/src/brdb/index.d.ts.map +1 -0
- package/dist/src/brdb/msgpack.d.ts +23 -0
- package/dist/src/brdb/msgpack.d.ts.map +1 -0
- package/dist/src/brdb/pending.d.ts +11 -0
- package/dist/src/brdb/pending.d.ts.map +1 -0
- package/dist/src/brdb/reader.d.ts +176 -0
- package/dist/src/brdb/reader.d.ts.map +1 -0
- package/dist/src/brdb/schema.d.ts +73 -0
- package/dist/src/brdb/schema.d.ts.map +1 -0
- package/dist/src/brdb/schemaText.d.ts +8 -0
- package/dist/src/brdb/schemaText.d.ts.map +1 -0
- package/dist/src/brdb/schemas.d.ts +4 -0
- package/dist/src/brdb/schemas.d.ts.map +1 -0
- package/dist/src/brdb/world.d.ts +80 -0
- package/dist/src/brdb/world.d.ts.map +1 -0
- package/dist/src/{constants.d.ts → brs/constants.d.ts} +1 -1
- package/dist/src/brs/constants.d.ts.map +1 -0
- package/dist/src/brs/read.d.ts.map +1 -0
- package/dist/src/brs/read.v1.d.ts.map +1 -0
- package/dist/src/brs/read.v10.d.ts.map +1 -0
- package/dist/src/brs/read.v14.d.ts.map +1 -0
- package/dist/src/brs/read.v2.d.ts.map +1 -0
- package/dist/src/brs/read.v3.d.ts.map +1 -0
- package/dist/src/brs/read.v4.d.ts.map +1 -0
- package/dist/src/brs/read.v8.d.ts.map +1 -0
- package/dist/src/brs/read.v9.d.ts.map +1 -0
- package/dist/src/brs/types.d.ts +1003 -0
- package/dist/src/brs/types.d.ts.map +1 -0
- package/dist/src/{utils.d.ts → brs/utils.d.ts} +4 -9
- package/dist/src/brs/utils.d.ts.map +1 -0
- package/dist/src/{write.d.ts → brs/write.d.ts} +1 -1
- package/dist/src/brs/write.d.ts.map +1 -0
- package/dist/src/index.d.ts +10 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/uuid.d.ts +1 -1
- package/dist/src/uuid.d.ts.map +1 -1
- package/package.json +42 -18
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/read.d.ts.map +0 -1
- package/dist/src/read.v1.d.ts.map +0 -1
- package/dist/src/read.v10.d.ts.map +0 -1
- package/dist/src/read.v14.d.ts.map +0 -1
- package/dist/src/read.v2.d.ts.map +0 -1
- package/dist/src/read.v3.d.ts.map +0 -1
- package/dist/src/read.v4.d.ts.map +0 -1
- package/dist/src/read.v8.d.ts.map +0 -1
- package/dist/src/read.v9.d.ts.map +0 -1
- package/dist/src/types.d.ts +0 -281
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/write.d.ts.map +0 -1
- /package/dist/src/{read.d.ts → brs/read.d.ts} +0 -0
- /package/dist/src/{read.v1.d.ts → brs/read.v1.d.ts} +0 -0
- /package/dist/src/{read.v10.d.ts → brs/read.v10.d.ts} +0 -0
- /package/dist/src/{read.v14.d.ts → brs/read.v14.d.ts} +0 -0
- /package/dist/src/{read.v2.d.ts → brs/read.v2.d.ts} +0 -0
- /package/dist/src/{read.v3.d.ts → brs/read.v3.d.ts} +0 -0
- /package/dist/src/{read.v4.d.ts → brs/read.v4.d.ts} +0 -0
- /package/dist/src/{read.v8.d.ts → brs/read.v8.d.ts} +0 -0
- /package/dist/src/{read.v9.d.ts → brs/read.v9.d.ts} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ByteReader, ByteWriter } from './bytes';
|
|
2
|
+
import { SchemaData } from './schemaText';
|
|
3
|
+
import { EmbeddedSchemaName } from './schemas';
|
|
4
|
+
export type PropDesc = {
|
|
5
|
+
kind: 'type' | 'array' | 'flatarray';
|
|
6
|
+
type: string;
|
|
7
|
+
} | {
|
|
8
|
+
kind: 'map';
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
/** Compact data form emitted by scripts/syncBrdbData.mjs:
|
|
13
|
+
* 'T' = plain type, ['T'] = array, ['T', null] = flat array,
|
|
14
|
+
* { K: 'V' } = map (single entry). */
|
|
15
|
+
export type SchemaSourceProp = string | readonly [string] | readonly [string, null] | Readonly<Record<string, string>>;
|
|
16
|
+
export interface SchemaSource {
|
|
17
|
+
enums: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
18
|
+
variants: Readonly<Record<string, readonly string[]>>;
|
|
19
|
+
structs: Readonly<Record<string, Readonly<Record<string, SchemaSourceProp>>>>;
|
|
20
|
+
}
|
|
21
|
+
export type BrdbValue = number | boolean | string | null | BrdbValue[] | {
|
|
22
|
+
[field: string]: BrdbValue;
|
|
23
|
+
};
|
|
24
|
+
/** A decoded variant value: which member the tag selected, plus its payload.
|
|
25
|
+
* Kept tagged (rather than flattened like the reference reader) so that
|
|
26
|
+
* decode -> encode round-trips byte-identically. */
|
|
27
|
+
export interface BrdbVariant {
|
|
28
|
+
$variant: string;
|
|
29
|
+
value: BrdbValue;
|
|
30
|
+
}
|
|
31
|
+
export declare class BrdbSchema {
|
|
32
|
+
readonly enums: Map<string, Map<string, number>>;
|
|
33
|
+
readonly variants: Map<string, string[]>;
|
|
34
|
+
readonly structs: Map<string, Map<string, PropDesc>>;
|
|
35
|
+
constructor(enums: Map<string, Map<string, number>>, variants: Map<string, string[]>, structs: Map<string, Map<string, PropDesc>>);
|
|
36
|
+
static fromText(text: string): BrdbSchema;
|
|
37
|
+
/** Hydrate a schema from the generated data form (see SchemaSource). */
|
|
38
|
+
static fromData(data: SchemaSource): BrdbSchema;
|
|
39
|
+
static fromBinary(bytes: Uint8Array): BrdbSchema;
|
|
40
|
+
/** Extract the named structs plus every type they transitively reference
|
|
41
|
+
* (sub-structs, enums, variants, and variant member types) into a
|
|
42
|
+
* self-contained subset. Primitive/unknown names are skipped. Uses a LIFO
|
|
43
|
+
* worklist; the result ORDER matches the reference implementation, and
|
|
44
|
+
* that order determines the serialized schema's bytes. */
|
|
45
|
+
extractStructsTransitive(seeds: Iterable<string>): SchemaData;
|
|
46
|
+
/** Merge definitions into this schema. Existing names keep their position
|
|
47
|
+
* (and are replaced); new names append, matching the reference merge. */
|
|
48
|
+
merge(data: SchemaData): void;
|
|
49
|
+
/** The zero value of a type: numbers 0, bool false, str '', asset refs
|
|
50
|
+
* null, arrays empty, structs recursive, enums ordinal 0, variants tag 0
|
|
51
|
+
* with the first member's zero value. */
|
|
52
|
+
zeroValue(ty: string): BrdbValue;
|
|
53
|
+
/** Complete a partial struct value: present fields pass through, missing
|
|
54
|
+
* fields get their zero value. Unknown keys are an error. */
|
|
55
|
+
fillStruct(structName: string, partial: Readonly<Record<string, BrdbValue>>): Record<string, BrdbValue>;
|
|
56
|
+
topoStructOrder(): string[];
|
|
57
|
+
toBinary(): Uint8Array;
|
|
58
|
+
flatTypeSize(ty: string): number;
|
|
59
|
+
writeValue(w: ByteWriter, ty: string, value: BrdbValue): void;
|
|
60
|
+
private writeVariantPayload;
|
|
61
|
+
private writeLegacyWireVariant;
|
|
62
|
+
private writeProperty;
|
|
63
|
+
private writeFlat;
|
|
64
|
+
private static readonly MAX_DECODE_DEPTH;
|
|
65
|
+
readValue(r: ByteReader, ty: string, depth?: number): BrdbValue;
|
|
66
|
+
private readLegacyWireVariant;
|
|
67
|
+
private readProperty;
|
|
68
|
+
private readFlat;
|
|
69
|
+
encode(ty: string, value: BrdbValue): Uint8Array;
|
|
70
|
+
decode(bytes: Uint8Array, ty: string): BrdbValue;
|
|
71
|
+
}
|
|
72
|
+
export declare function embeddedSchema(name: EmbeddedSchemaName): BrdbSchema;
|
|
73
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/brdb/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAwBjD,OAAO,EAAmB,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAW,MAAM,WAAW,CAAC;AAExD,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD;;sCAEsC;AACtC,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,SAAS,CAAC,MAAM,CAAC,GACjB,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,GACvB,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,QAAQ,CA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,GAAG,UAAU,CAOnE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropDesc } from './schema';
|
|
2
|
+
export interface SchemaData {
|
|
3
|
+
enums: Map<string, Map<string, number>>;
|
|
4
|
+
variants: Map<string, string[]>;
|
|
5
|
+
structs: Map<string, Map<string, PropDesc>>;
|
|
6
|
+
}
|
|
7
|
+
export declare function parseSchemaText(text: string): SchemaData;
|
|
8
|
+
//# sourceMappingURL=schemaText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaText.d.ts","sourceRoot":"","sources":["../../../src/brdb/schemaText.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACxC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;CAC7C;AAkBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAmExD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SchemaSource } from './schema';
|
|
2
|
+
export type EmbeddedSchemaName = 'BRSavedGlobalDataSoA' | 'BRSavedOwnerTableSoA' | 'BRSavedBrickChunkIndexSoA' | 'BRSavedBrickChunkSoA' | 'BRSavedWireChunkSoA' | 'BRSavedComponentChunkSoA' | 'BRSavedComponentChunkSoA_max' | 'BRSavedEntityChunkIndexSoA' | 'BRSavedEntityChunkSoA';
|
|
3
|
+
export declare const SCHEMAS: Record<EmbeddedSchemaName, SchemaSource>;
|
|
4
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/brdb/schemas.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,sBAAsB,GACtB,2BAA2B,GAC3B,sBAAsB,GACtB,qBAAqB,GACrB,0BAA0B,GAC1B,8BAA8B,GAC9B,4BAA4B,GAC5B,uBAAuB,CAAC;AAE5B,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAivD5D,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { WriteSaveObject } from '../brs/types';
|
|
2
|
+
import { Compressor } from './brz';
|
|
3
|
+
import { PendingEntry } from './pending';
|
|
4
|
+
import { BrdbValue } from './schema';
|
|
5
|
+
export declare const CHUNK_SIZE = 2048;
|
|
6
|
+
export declare const CHUNK_HALF = 1024;
|
|
7
|
+
export interface BundleJson {
|
|
8
|
+
type: string;
|
|
9
|
+
iD: string;
|
|
10
|
+
name: string;
|
|
11
|
+
version: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
authors: string[];
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
description: string;
|
|
17
|
+
dependencies: unknown[];
|
|
18
|
+
gameVersion: string;
|
|
19
|
+
}
|
|
20
|
+
export interface WriteBrzOptions {
|
|
21
|
+
/** zstd compressor for blobs; omitted -> all blobs stored raw (valid, and
|
|
22
|
+
* what the byte-parity gates compare against). */
|
|
23
|
+
compress?: Compressor;
|
|
24
|
+
/** Meta/World.json environment. save.map is NOT used. Default "Plate". */
|
|
25
|
+
environment?: string;
|
|
26
|
+
/** Meta/Bundle.json field overrides. */
|
|
27
|
+
bundle?: Partial<BundleJson>;
|
|
28
|
+
}
|
|
29
|
+
/** A brdb-native component on a brick. Legacy brs components
|
|
30
|
+
* (save.components / brick.components) are NOT converted. */
|
|
31
|
+
export interface BrdbComponentInput {
|
|
32
|
+
/** brdb component type name, e.g. 'Component_Internal_Seat' */
|
|
33
|
+
type: string;
|
|
34
|
+
/** fields of the component's data struct; omitted fields zero-fill */
|
|
35
|
+
data?: Record<string, BrdbValue>;
|
|
36
|
+
}
|
|
37
|
+
export interface BrdbWireEndpointInput {
|
|
38
|
+
/** index into save.bricks */
|
|
39
|
+
brick_index: number;
|
|
40
|
+
/** brdb component type name (must be used by a brick in this save) */
|
|
41
|
+
component_type: string;
|
|
42
|
+
/** wire port name, e.g. 'Output' */
|
|
43
|
+
port: string;
|
|
44
|
+
}
|
|
45
|
+
/** A wire between two component ports, using brdb-native names. Legacy
|
|
46
|
+
* save.wires (brs component names) are NOT converted. */
|
|
47
|
+
export interface BrdbWireInput {
|
|
48
|
+
source: BrdbWireEndpointInput;
|
|
49
|
+
target: BrdbWireEndpointInput;
|
|
50
|
+
}
|
|
51
|
+
/** brdb-native extras alongside the legacy save shape: bricks carry a
|
|
52
|
+
* modern `components` ARRAY of typed inputs (replacing the legacy .brs
|
|
53
|
+
* component map on that field, which is not converted) and the save
|
|
54
|
+
* carries `wires`. */
|
|
55
|
+
export interface BrdbBrickExtras {
|
|
56
|
+
components?: BrdbComponentInput[];
|
|
57
|
+
}
|
|
58
|
+
export interface BrdbSaveExtras {
|
|
59
|
+
wires?: BrdbWireInput[];
|
|
60
|
+
}
|
|
61
|
+
/** The legacy save shape plus the brdb-native extras. The brick-level
|
|
62
|
+
* legacy `components` map and the save-level legacy `wires` list are
|
|
63
|
+
* replaced by the modern forms. */
|
|
64
|
+
export type WriteBrzSave = Omit<WriteSaveObject, 'bricks' | 'wires'> & {
|
|
65
|
+
bricks: (Omit<WriteSaveObject['bricks'][number], 'components'> & BrdbBrickExtras)[];
|
|
66
|
+
} & BrdbSaveExtras;
|
|
67
|
+
/** What the world writers accept: the modern shape, or an unmodified
|
|
68
|
+
* legacy save (whose map-shaped `components` and legacy-named `wires`
|
|
69
|
+
* are ignored rather than converted). */
|
|
70
|
+
export type WriteBrzInput = WriteBrzSave | WriteSaveObject;
|
|
71
|
+
export declare function toRelative(position: readonly number[]): {
|
|
72
|
+
chunk: [number, number, number];
|
|
73
|
+
rel: [number, number, number];
|
|
74
|
+
};
|
|
75
|
+
export declare function saveToPendingFs(save: WriteBrzInput, options?: WriteBrzOptions): PendingEntry[];
|
|
76
|
+
/** Write a .brz world from a legacy .brs-shaped WriteSaveObject. A
|
|
77
|
+
* builder-style world API for authoring saves from scratch is planned;
|
|
78
|
+
* this entry point exists for converting existing saves. */
|
|
79
|
+
export declare function writeBrzLegacy(save: WriteBrzInput, options?: WriteBrzOptions): Uint8Array;
|
|
80
|
+
//# sourceMappingURL=world.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"world.d.ts","sourceRoot":"","sources":["../../../src/brdb/world.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAuB,UAAU,EAAqB,MAAM,OAAO,CAAC;AAK3E,OAAO,EAAgB,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAc,SAAS,EAAkB,MAAM,UAAU,CAAC;AAGjE,eAAO,MAAM,UAAU,OAAO,CAAC;AAC/B,eAAO,MAAM,UAAU,OAAO,CAAC;AAE/B,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B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,CAAC;IAChC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAYA;AAuTD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,eAAoB,GAC5B,YAAY,EAAE,CA2XhB;AAED;;4DAE4D;AAC5D,wBAAgB,cAAc,CAC5B,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,eAAoB,GAC5B,UAAU,CAGZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/brs/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,eAAO,MAAM,KAAK,yBAA+B,CAAC;AAClD,eAAO,MAAM,cAAc,KAAK,CAAC;AACjC,eAAO,MAAM,OAAO,QAAa,CAAC;AAClC,eAAO,MAAM,YAAY,EAAE,IAA6C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/brs/read.ts"],"names":[],"mappings":"AASA,OAAO,EAAY,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIhE,MAAM,CAAC,OAAO,UAAU,OAAO,CAC7B,QAAQ,EAAE,UAAU,EACpB,OAAO,GAAE,WAAgB,GACxB,cAAc,CA2ChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v1.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,KAAK,EACL,WAAW,EAGZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,KAAK,CAoFP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v10.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v10.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,MAAM,EAEN,WAAW,EAIZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,MAAM,CAwKR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v14.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v14.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,MAAM,EAEN,WAAW,EAKZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,UAAU,CAChC,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,MAAM,CAkNR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v2.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,KAAK,EACL,WAAW,EAGZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,KAAK,CAuFP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v3.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v3.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,KAAK,EACL,WAAW,EAIZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,KAAK,CA+FP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v4.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v4.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EACR,KAAK,EACL,WAAW,EAGZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,KAAK,CAiGP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v8.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v8.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,KAAK,EACL,WAAW,EAIZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,KAAK,CA2JP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.v9.d.ts","sourceRoot":"","sources":["../../../src/brs/read.v9.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,KAAK,EAEL,WAAW,EAIZ,MAAM,SAAS,CAAC;AAIjB,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,WAAgB,GACxB,KAAK,CAmKP"}
|