@stryke/capnp 0.9.13 → 0.10.1
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/bin/capnpc.cjs +1849 -1797
- package/bin/capnpc.js +1848 -1796
- package/dist/compile.cjs +78 -0
- package/dist/compile.d.cts +38 -0
- package/dist/compile.d.ts +38 -0
- package/dist/compile.js +78 -0
- package/dist/helpers.cjs +70 -0
- package/dist/helpers.d.cts +13 -0
- package/dist/helpers.d.ts +13 -0
- package/dist/helpers.js +70 -0
- package/dist/index.cjs +4 -129
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -129
- package/dist/rpc.cjs +117 -5
- package/dist/rpc.d.cts +25 -7
- package/dist/rpc.d.ts +25 -7
- package/dist/rpc.js +116 -4
- package/dist/types.cjs +8 -3
- package/dist/types.d.cts +11 -2
- package/dist/types.d.ts +11 -2
- package/dist/types.js +8 -3
- package/dts/index.d.cts +658 -489
- package/dts/index.d.ts +658 -489
- package/package.json +21 -5
- package/schemas/{chunk-3Y2DQ67Z.cjs → chunk-BM2HWFSD.cjs} +597 -1
- package/schemas/{chunk-SCCB7KM2.js → chunk-TAKPBFYZ.js} +596 -0
- package/schemas/persistent.cjs +20 -20
- package/schemas/persistent.js +1 -1
- package/schemas/rpc-twoparty.cjs +32 -32
- package/schemas/rpc-twoparty.js +1 -1
- package/schemas/rpc.cjs +495 -495
- package/schemas/rpc.js +1 -1
- package/schemas/schema.cjs +675 -675
- package/schemas/schema.js +1 -1
- package/dist/chunk-4Z2FMN72.cjs +0 -7924
- package/dist/chunk-CCU32X36.js +0 -15
- package/dist/chunk-L563IRIF.js +0 -7924
- package/dist/chunk-R2JXWA7Q.cjs +0 -15
package/dts/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
|
|
1
3
|
import { MessagePort as MessagePort$1 } from 'node:worker_threads';
|
|
2
4
|
import { ParsedCommandLine } from 'typescript';
|
|
3
5
|
|
|
@@ -2691,517 +2693,223 @@ export declare class Data extends List<number> {
|
|
|
2691
2693
|
*/
|
|
2692
2694
|
toUint8Array(): Uint8Array;
|
|
2693
2695
|
}
|
|
2694
|
-
declare class
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
*/
|
|
2704
|
-
export declare class Pipeline<AnswerResults extends Struct, ParentResults extends Struct, Results extends Struct> {
|
|
2705
|
-
ResultsClass: StructCtor<Results>;
|
|
2706
|
-
answer: Answer<AnswerResults>;
|
|
2707
|
-
parent?: Pipeline<AnswerResults, Struct, ParentResults> | undefined;
|
|
2708
|
-
op: PipelineOp;
|
|
2709
|
-
pipelineClient?: PipelineClient<AnswerResults, ParentResults, Results>;
|
|
2710
|
-
constructor(ResultsClass: StructCtor<Results>, answer: Answer<AnswerResults>, op?: PipelineOp, parent?: Pipeline<AnswerResults, Struct, ParentResults> | undefined);
|
|
2711
|
-
transform(): PipelineOp[];
|
|
2712
|
-
struct(): Promise<Results>;
|
|
2713
|
-
client(): PipelineClient<AnswerResults, ParentResults, Results>;
|
|
2714
|
-
getPipeline<RR extends Struct>(ResultsClass: StructCtor<RR>, off: number, defaultValue?: Pointer): Pipeline<AnswerResults, Results, RR>;
|
|
2715
|
-
}
|
|
2716
|
-
export declare abstract class DeferredTransport implements Transport {
|
|
2717
|
-
protected d?: Deferred<Message$1>;
|
|
2718
|
-
protected closed: boolean;
|
|
2719
|
-
abstract sendMessage(msg: Message$1): void;
|
|
2720
|
-
close(): void;
|
|
2721
|
-
recvMessage(): Promise<Message$1>;
|
|
2722
|
-
protected reject: (err: unknown) => void;
|
|
2723
|
-
protected resolve: (buf: ArrayBuffer) => void;
|
|
2696
|
+
declare class Node_Parameter extends Struct {
|
|
2697
|
+
static readonly _capnp: {
|
|
2698
|
+
displayName: string;
|
|
2699
|
+
id: string;
|
|
2700
|
+
size: ObjectSize;
|
|
2701
|
+
};
|
|
2702
|
+
get name(): string;
|
|
2703
|
+
set name(value: string);
|
|
2704
|
+
toString(): string;
|
|
2724
2705
|
}
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2706
|
+
declare class Node_NestedNode extends Struct {
|
|
2707
|
+
static readonly _capnp: {
|
|
2708
|
+
displayName: string;
|
|
2709
|
+
id: string;
|
|
2710
|
+
size: ObjectSize;
|
|
2711
|
+
};
|
|
2712
|
+
/**
|
|
2713
|
+
* Unqualified symbol name. Unlike Node.displayName, this *can* be used programmatically.
|
|
2714
|
+
*
|
|
2715
|
+
* (On Zooko's triangle, this is the node's petname according to its parent scope.)
|
|
2716
|
+
*
|
|
2717
|
+
*/
|
|
2718
|
+
get name(): string;
|
|
2719
|
+
set name(value: string);
|
|
2720
|
+
/**
|
|
2721
|
+
* ID of the nested node. Typically, the target node's scopeId points back to this node, but
|
|
2722
|
+
* robust code should avoid relying on this.
|
|
2723
|
+
*
|
|
2724
|
+
*/
|
|
2725
|
+
get id(): bigint;
|
|
2726
|
+
set id(value: bigint);
|
|
2727
|
+
toString(): string;
|
|
2730
2728
|
}
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2729
|
+
declare class Node_SourceInfo_Member extends Struct {
|
|
2730
|
+
static readonly _capnp: {
|
|
2731
|
+
displayName: string;
|
|
2732
|
+
id: string;
|
|
2733
|
+
size: ObjectSize;
|
|
2734
|
+
};
|
|
2735
|
+
/**
|
|
2736
|
+
* Doc comment on the member.
|
|
2737
|
+
*
|
|
2738
|
+
*/
|
|
2739
|
+
get docComment(): string;
|
|
2740
|
+
set docComment(value: string);
|
|
2741
|
+
toString(): string;
|
|
2734
2742
|
}
|
|
2735
|
-
|
|
2736
|
-
static readonly
|
|
2737
|
-
static
|
|
2738
|
-
|
|
2743
|
+
declare class Node_SourceInfo extends Struct {
|
|
2744
|
+
static readonly Member: typeof Node_SourceInfo_Member;
|
|
2745
|
+
static readonly _capnp: {
|
|
2746
|
+
displayName: string;
|
|
2747
|
+
id: string;
|
|
2748
|
+
size: ObjectSize;
|
|
2749
|
+
};
|
|
2750
|
+
static _Members: ListCtor<Node_SourceInfo_Member>;
|
|
2751
|
+
/**
|
|
2752
|
+
* ID of the Node which this info describes.
|
|
2753
|
+
*
|
|
2754
|
+
*/
|
|
2755
|
+
get id(): bigint;
|
|
2756
|
+
set id(value: bigint);
|
|
2757
|
+
/**
|
|
2758
|
+
* The top-level doc comment for the Node.
|
|
2759
|
+
*
|
|
2760
|
+
*/
|
|
2761
|
+
get docComment(): string;
|
|
2762
|
+
set docComment(value: string);
|
|
2763
|
+
_adoptMembers(value: Orphan<List<Node_SourceInfo_Member>>): void;
|
|
2764
|
+
_disownMembers(): Orphan<List<Node_SourceInfo_Member>>;
|
|
2765
|
+
/**
|
|
2766
|
+
* Information about each member -- i.e. fields (for structs), enumerants (for enums), or
|
|
2767
|
+
* methods (for interfaces).
|
|
2768
|
+
*
|
|
2769
|
+
* This list is the same length and order as the corresponding list in the Node, i.e.
|
|
2770
|
+
* Node.struct.fields, Node.enum.enumerants, or Node.interface.methods.
|
|
2771
|
+
*
|
|
2772
|
+
*/
|
|
2773
|
+
get members(): List<Node_SourceInfo_Member>;
|
|
2774
|
+
_hasMembers(): boolean;
|
|
2775
|
+
_initMembers(length: number): List<Node_SourceInfo_Member>;
|
|
2776
|
+
set members(value: List<Node_SourceInfo_Member>);
|
|
2777
|
+
toString(): string;
|
|
2739
2778
|
}
|
|
2740
|
-
|
|
2741
|
-
static
|
|
2779
|
+
declare class Node_Struct extends Struct {
|
|
2780
|
+
static readonly _capnp: {
|
|
2781
|
+
displayName: string;
|
|
2782
|
+
id: string;
|
|
2783
|
+
size: ObjectSize;
|
|
2784
|
+
};
|
|
2785
|
+
static _Fields: ListCtor<Field>;
|
|
2742
2786
|
/**
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
get(index?: number): string;
|
|
2787
|
+
* Size of the data section, in words.
|
|
2788
|
+
*
|
|
2789
|
+
*/
|
|
2790
|
+
get dataWordCount(): number;
|
|
2791
|
+
set dataWordCount(value: number);
|
|
2749
2792
|
/**
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2793
|
+
* Size of the pointer section, in pointers (which are one word each).
|
|
2794
|
+
*
|
|
2795
|
+
*/
|
|
2796
|
+
get pointerCount(): number;
|
|
2797
|
+
set pointerCount(value: number);
|
|
2755
2798
|
/**
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
set(
|
|
2799
|
+
* The preferred element size to use when encoding a list of this struct. If this is anything
|
|
2800
|
+
* other than `inlineComposite` then the struct is one word or less in size and is a candidate
|
|
2801
|
+
* for list packing optimization.
|
|
2802
|
+
*
|
|
2803
|
+
*/
|
|
2804
|
+
get preferredListEncoding(): ElementSize;
|
|
2805
|
+
set preferredListEncoding(value: ElementSize);
|
|
2806
|
+
/**
|
|
2807
|
+
* If true, then this "struct" node is actually not an independent node, but merely represents
|
|
2808
|
+
* some named union or group within a particular parent struct. This node's scopeId refers
|
|
2809
|
+
* to the parent struct, which may itself be a union/group in yet another struct.
|
|
2810
|
+
*
|
|
2811
|
+
* All group nodes share the same dataWordCount and pointerCount as the top-level
|
|
2812
|
+
* struct, and their fields live in the same ordinal and offset spaces as all other fields in
|
|
2813
|
+
* the struct.
|
|
2814
|
+
*
|
|
2815
|
+
* Note that a named union is considered a special kind of group -- in fact, a named union
|
|
2816
|
+
* is exactly equivalent to a group that contains nothing but an unnamed union.
|
|
2817
|
+
*
|
|
2818
|
+
*/
|
|
2819
|
+
get isGroup(): boolean;
|
|
2820
|
+
set isGroup(value: boolean);
|
|
2821
|
+
/**
|
|
2822
|
+
* Number of fields in this struct which are members of an anonymous union, and thus may
|
|
2823
|
+
* overlap. If this is non-zero, then a 16-bit discriminant is present indicating which
|
|
2824
|
+
* of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be
|
|
2825
|
+
* two or more.
|
|
2826
|
+
*
|
|
2827
|
+
* Note that the fields of an unnamed union are considered fields of the scope containing the
|
|
2828
|
+
* union -- an unnamed union is not its own group. So, a top-level struct may contain a
|
|
2829
|
+
* non-zero discriminant count. Named unions, on the other hand, are equivalent to groups
|
|
2830
|
+
* containing unnamed unions. So, a named union has its own independent schema node, with
|
|
2831
|
+
* `isGroup` = true.
|
|
2832
|
+
*
|
|
2833
|
+
*/
|
|
2834
|
+
get discriminantCount(): number;
|
|
2835
|
+
set discriminantCount(value: number);
|
|
2836
|
+
/**
|
|
2837
|
+
* If `discriminantCount` is non-zero, this is the offset of the union discriminant, in
|
|
2838
|
+
* multiples of 16 bits.
|
|
2839
|
+
*
|
|
2840
|
+
*/
|
|
2841
|
+
get discriminantOffset(): number;
|
|
2842
|
+
set discriminantOffset(value: number);
|
|
2843
|
+
_adoptFields(value: Orphan<List<Field>>): void;
|
|
2844
|
+
_disownFields(): Orphan<List<Field>>;
|
|
2845
|
+
/**
|
|
2846
|
+
* Fields defined within this scope (either the struct's top-level fields, or the fields of
|
|
2847
|
+
* a particular group; see `isGroup`).
|
|
2848
|
+
*
|
|
2849
|
+
* The fields are sorted by ordinal number, but note that because groups share the same
|
|
2850
|
+
* ordinal space, the field's index in this list is not necessarily exactly its ordinal.
|
|
2851
|
+
* On the other hand, the field's position in this list does remain the same even as the
|
|
2852
|
+
* protocol evolves, since it is not possible to insert or remove an earlier ordinal.
|
|
2853
|
+
* Therefore, for most use cases, if you want to identify a field by number, it may make the
|
|
2854
|
+
* most sense to use the field's index in this list rather than its ordinal.
|
|
2855
|
+
*
|
|
2856
|
+
*/
|
|
2857
|
+
get fields(): List<Field>;
|
|
2858
|
+
_hasFields(): boolean;
|
|
2859
|
+
_initFields(length: number): List<Field>;
|
|
2860
|
+
set fields(value: List<Field>);
|
|
2763
2861
|
toString(): string;
|
|
2764
|
-
toJSON(): string;
|
|
2765
|
-
[Symbol.toPrimitive](): string;
|
|
2766
|
-
[Symbol.toStringTag](): string;
|
|
2767
2862
|
}
|
|
2768
|
-
|
|
2769
|
-
static readonly _capnp:
|
|
2863
|
+
declare class Node_Enum extends Struct {
|
|
2864
|
+
static readonly _capnp: {
|
|
2865
|
+
displayName: string;
|
|
2866
|
+
id: string;
|
|
2867
|
+
size: ObjectSize;
|
|
2868
|
+
};
|
|
2869
|
+
static _Enumerants: ListCtor<Enumerant>;
|
|
2870
|
+
_adoptEnumerants(value: Orphan<List<Enumerant>>): void;
|
|
2871
|
+
_disownEnumerants(): Orphan<List<Enumerant>>;
|
|
2872
|
+
/**
|
|
2873
|
+
* Enumerants ordered by numeric value (ordinal).
|
|
2874
|
+
*
|
|
2875
|
+
*/
|
|
2876
|
+
get enumerants(): List<Enumerant>;
|
|
2877
|
+
_hasEnumerants(): boolean;
|
|
2878
|
+
_initEnumerants(length: number): List<Enumerant>;
|
|
2879
|
+
set enumerants(value: List<Enumerant>);
|
|
2880
|
+
toString(): string;
|
|
2770
2881
|
}
|
|
2771
|
-
declare
|
|
2772
|
-
declare function initStructAt<T extends Struct>(index: number, StructClass: StructCtor<T>, p: Pointer): T;
|
|
2773
|
-
declare function checkPointerBounds(index: number, s: Struct): void;
|
|
2774
|
-
declare function getInterfaceClientOrNullAt(index: number, s: Struct): Client;
|
|
2775
|
-
declare function getInterfaceClientOrNull(p: Pointer): Client;
|
|
2776
|
-
declare function resize(dstSize: ObjectSize, s: Struct): void;
|
|
2777
|
-
declare function getAs<T extends Struct>(StructClass: StructCtor<T>, s: Struct): T;
|
|
2778
|
-
declare function getBit(bitOffset: number, s: Struct, defaultMask?: DataView): boolean;
|
|
2779
|
-
declare function getData(index: number, s: Struct, defaultValue?: Pointer): Data;
|
|
2780
|
-
declare function getDataSection(s: Struct): Pointer;
|
|
2781
|
-
declare function getFloat32(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2782
|
-
declare function getFloat64(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2783
|
-
declare function getInt16(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2784
|
-
declare function getInt32(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2785
|
-
declare function getInt64(byteOffset: number, s: Struct, defaultMask?: DataView): bigint;
|
|
2786
|
-
declare function getInt8(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2787
|
-
declare function getList<T>(index: number, ListClass: ListCtor<T>, s: Struct, defaultValue?: Pointer): List<T>;
|
|
2788
|
-
declare function getPointer(index: number, s: Struct): Pointer;
|
|
2789
|
-
declare function getPointerAs<T extends Pointer>(index: number, PointerClass: PointerCtor<T>, s: Struct): T;
|
|
2790
|
-
declare function getPointerSection(s: Struct): Pointer;
|
|
2791
|
-
declare function getSize(s: Struct): ObjectSize;
|
|
2792
|
-
declare function getStruct<T extends Struct>(index: number, StructClass: StructCtor<T>, s: Struct, defaultValue?: Pointer): T;
|
|
2793
|
-
declare function getText(index: number, s: Struct, defaultValue?: string): string;
|
|
2794
|
-
declare function getUint16(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2795
|
-
declare function getUint32(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2796
|
-
declare function getUint64(byteOffset: number, s: Struct, defaultMask?: DataView): bigint;
|
|
2797
|
-
declare function getUint8(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
2798
|
-
declare function initData(index: number, length: number, s: Struct): Data;
|
|
2799
|
-
declare function initList<T>(index: number, ListClass: ListCtor<T>, length: number, s: Struct): List<T>;
|
|
2800
|
-
declare function setBit(bitOffset: number, value: boolean, s: Struct, defaultMask?: DataView): void;
|
|
2801
|
-
declare function setFloat32(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2802
|
-
declare function setFloat64(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2803
|
-
declare function setInt16(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2804
|
-
declare function setInt32(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2805
|
-
declare function setInt64(byteOffset: number, value: bigint, s: Struct, defaultMask?: DataView): void;
|
|
2806
|
-
declare function setInt8(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2807
|
-
declare function setText(index: number, value: string, s: Struct): void;
|
|
2808
|
-
declare function setUint16(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2809
|
-
declare function setUint32(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2810
|
-
declare function setUint64(byteOffset: number, value: bigint, s: Struct, defaultMask?: DataView): void;
|
|
2811
|
-
declare function setUint8(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
2812
|
-
declare function testWhich(name: string, found: number, wanted: number, s: Struct): void;
|
|
2813
|
-
declare function checkDataBounds(byteOffset: number, byteLength: number, s: Struct): void;
|
|
2814
|
-
declare function adopt<T extends Pointer>(src: Orphan<T>, p: T): void;
|
|
2815
|
-
declare function disown<T extends Pointer>(p: T): Orphan<T>;
|
|
2816
|
-
declare function dump$1(p: Pointer): string;
|
|
2817
|
-
declare function getListByteLength(elementSize: ListElementSize, length: number, compositeSize?: ObjectSize): number;
|
|
2818
|
-
declare function getListElementByteLength(elementSize: ListElementSize): number;
|
|
2819
|
-
declare function add(offset: number, p: Pointer): Pointer;
|
|
2820
|
-
declare function copyFrom(src: Pointer, p: Pointer): void;
|
|
2821
|
-
declare function erase(p: Pointer): void;
|
|
2822
|
-
declare function erasePointer(p: Pointer): void;
|
|
2823
|
-
declare function followFar(p: Pointer): Pointer;
|
|
2824
|
-
declare function followFars(p: Pointer): Pointer;
|
|
2825
|
-
declare function getCapabilityId(p: Pointer): number;
|
|
2826
|
-
declare function getContent(p: Pointer, ignoreCompositeIndex?: boolean): Pointer;
|
|
2827
|
-
declare function getFarSegmentId(p: Pointer): number;
|
|
2828
|
-
declare function getListElementSize(p: Pointer): ListElementSize;
|
|
2829
|
-
declare function getListLength(p: Pointer): number;
|
|
2830
|
-
declare function getOffsetWords(p: Pointer): number;
|
|
2831
|
-
declare function getPointerType(p: Pointer): PointerType;
|
|
2832
|
-
declare function getStructDataWords(p: Pointer): number;
|
|
2833
|
-
declare function getStructPointerLength(p: Pointer): number;
|
|
2834
|
-
declare function getStructSize(p: Pointer): ObjectSize;
|
|
2835
|
-
declare function getTargetCompositeListTag(p: Pointer): Pointer;
|
|
2836
|
-
declare function getTargetCompositeListSize(p: Pointer): ObjectSize;
|
|
2837
|
-
declare function getTargetListElementSize(p: Pointer): ListElementSize;
|
|
2838
|
-
declare function getTargetListLength(p: Pointer): number;
|
|
2839
|
-
declare function getTargetPointerType(p: Pointer): PointerType;
|
|
2840
|
-
declare function getTargetStructSize(p: Pointer): ObjectSize;
|
|
2841
|
-
declare function initPointer(contentSegment: Segment, contentOffset: number, p: Pointer): PointerAllocationResult;
|
|
2842
|
-
declare function isDoubleFar(p: Pointer): boolean;
|
|
2843
|
-
declare function isNull(p: Pointer): boolean;
|
|
2844
|
-
declare function relocateTo(dst: Pointer, src: Pointer): void;
|
|
2845
|
-
declare function setFarPointer(doubleFar: boolean, offsetWords: number, segmentId: number, p: Pointer): void;
|
|
2846
|
-
declare function setInterfacePointer(capId: number, p: Pointer): void;
|
|
2847
|
-
declare function getInterfacePointer(p: Pointer): number;
|
|
2848
|
-
declare function setListPointer(offsetWords: number, size: ListElementSize, length: number, p: Pointer, compositeSize?: ObjectSize): void;
|
|
2849
|
-
declare function setStructPointer(offsetWords: number, size: ObjectSize, p: Pointer): void;
|
|
2850
|
-
declare function validate(pointerType: PointerType, p: Pointer, elementSize?: ListElementSize): void;
|
|
2851
|
-
declare function copyFromInterface(src: Pointer, dst: Pointer): void;
|
|
2852
|
-
declare function copyFromList(src: Pointer, dst: Pointer): void;
|
|
2853
|
-
declare function copyFromStruct(src: Pointer, dst: Pointer): void;
|
|
2854
|
-
declare function trackPointerAllocation(message: Message, p: Pointer): void;
|
|
2855
|
-
declare class PointerAllocationResult {
|
|
2856
|
-
readonly pointer: Pointer;
|
|
2857
|
-
readonly offsetWords: number;
|
|
2858
|
-
constructor(pointer: Pointer, offsetWords: number);
|
|
2859
|
-
}
|
|
2860
|
-
export declare namespace utils {
|
|
2861
|
-
export { PointerAllocationResult, add, adopt, checkDataBounds, checkPointerBounds, copyFrom, copyFromInterface, copyFromList, copyFromStruct, disown, dump$1, erase, erasePointer, followFar, followFars, getAs, getBit, getCapabilityId, getContent, getData, getDataSection, getFarSegmentId, getFloat32, getFloat64, getInt16, getInt32, getInt64, getInt8, getInterfaceClientOrNull, getInterfaceClientOrNullAt, getInterfacePointer, getList, getListByteLength, getListElementByteLength, getListElementSize, getListLength, getOffsetWords, getPointer, getPointerAs, getPointerSection, getPointerType, getSize, getStruct, getStructDataWords, getStructPointerLength, getStructSize, getTargetCompositeListSize, getTargetCompositeListTag, getTargetListElementSize, getTargetListLength, getTargetPointerType, getTargetStructSize, getText, getUint16, getUint32, getUint64, getUint8, initData, initList, initPointer, initStruct, initStructAt, isDoubleFar, isNull, relocateTo, resize, setBit, setFarPointer, setFloat32, setFloat64, setInt16, setInt32, setInt64, setInt8, setInterfacePointer, setListPointer, setStructPointer, setText, setUint16, setUint32, setUint64, setUint8, testWhich, trackPointerAllocation, validate };
|
|
2862
|
-
}
|
|
2863
|
-
export declare const AnyPointerList: ListCtor<Pointer>;
|
|
2864
|
-
export declare class BoolList extends List<boolean> {
|
|
2865
|
-
static readonly _capnp: _ListCtor;
|
|
2866
|
-
get(index: number): boolean;
|
|
2867
|
-
set(index: number, value: boolean): void;
|
|
2868
|
-
[Symbol.toStringTag](): string;
|
|
2869
|
-
}
|
|
2870
|
-
export declare function CompositeList<T extends Struct>(CompositeClass: StructCtor<T>): ListCtor<T>;
|
|
2871
|
-
export declare const DataList: ListCtor<Data>;
|
|
2872
|
-
export declare class Float32List extends List<number> {
|
|
2873
|
-
static readonly _capnp: _ListCtor;
|
|
2874
|
-
get(index: number): number;
|
|
2875
|
-
set(index: number, value: number): void;
|
|
2876
|
-
[Symbol.toStringTag](): string;
|
|
2877
|
-
}
|
|
2878
|
-
export declare class Float64List extends List<number> {
|
|
2879
|
-
static readonly _capnp: _ListCtor;
|
|
2880
|
-
get(index: number): number;
|
|
2881
|
-
set(index: number, value: number): void;
|
|
2882
|
-
[Symbol.toStringTag](): string;
|
|
2883
|
-
}
|
|
2884
|
-
export declare class Int8List extends List<number> {
|
|
2885
|
-
static readonly _capnp: _ListCtor;
|
|
2886
|
-
get(index: number): number;
|
|
2887
|
-
set(index: number, value: number): void;
|
|
2888
|
-
[Symbol.toStringTag](): string;
|
|
2889
|
-
}
|
|
2890
|
-
export declare class Int16List extends List<number> {
|
|
2891
|
-
static readonly _capnp: _ListCtor;
|
|
2892
|
-
get(index: number): number;
|
|
2893
|
-
set(index: number, value: number): void;
|
|
2894
|
-
[Symbol.toStringTag](): string;
|
|
2895
|
-
}
|
|
2896
|
-
export declare class Int32List extends List<number> {
|
|
2897
|
-
static readonly _capnp: _ListCtor;
|
|
2898
|
-
get(index: number): number;
|
|
2899
|
-
set(index: number, value: number): void;
|
|
2900
|
-
[Symbol.toStringTag](): string;
|
|
2901
|
-
}
|
|
2902
|
-
export declare class Int64List extends List<bigint> {
|
|
2903
|
-
static readonly _capnp: _ListCtor;
|
|
2904
|
-
get(index: number): bigint;
|
|
2905
|
-
set(index: number, value: bigint): void;
|
|
2906
|
-
[Symbol.toStringTag](): string;
|
|
2907
|
-
}
|
|
2908
|
-
export declare const InterfaceList: ListCtor<Interface>;
|
|
2909
|
-
export declare function PointerList<T extends Pointer>(PointerClass: PointerCtor<T>): ListCtor<T>;
|
|
2910
|
-
export declare class TextList extends List<string> {
|
|
2911
|
-
static readonly _capnp: _ListCtor;
|
|
2912
|
-
get(index: number): string;
|
|
2913
|
-
set(index: number, value: string): void;
|
|
2914
|
-
[Symbol.toStringTag](): string;
|
|
2915
|
-
}
|
|
2916
|
-
export declare class Uint8List extends List<number> {
|
|
2917
|
-
static readonly _capnp: _ListCtor;
|
|
2918
|
-
get(index: number): number;
|
|
2919
|
-
set(index: number, value: number): void;
|
|
2920
|
-
[Symbol.toStringTag](): string;
|
|
2921
|
-
}
|
|
2922
|
-
export declare class Uint16List extends List<number> {
|
|
2923
|
-
static readonly _capnp: _ListCtor;
|
|
2924
|
-
get(index: number): number;
|
|
2925
|
-
set(index: number, value: number): void;
|
|
2926
|
-
[Symbol.toStringTag](): string;
|
|
2927
|
-
}
|
|
2928
|
-
export declare class Uint32List extends List<number> {
|
|
2929
|
-
static readonly _capnp: _ListCtor;
|
|
2930
|
-
get(index: number): number;
|
|
2931
|
-
set(index: number, value: number): void;
|
|
2932
|
-
[Symbol.toStringTag](): string;
|
|
2933
|
-
}
|
|
2934
|
-
export declare class Uint64List extends List<bigint> {
|
|
2935
|
-
static readonly _capnp: _ListCtor;
|
|
2936
|
-
get(index: number): bigint;
|
|
2937
|
-
set(index: number, value: bigint): void;
|
|
2938
|
-
[Symbol.toStringTag](): string;
|
|
2939
|
-
}
|
|
2940
|
-
export declare const VoidList: ListCtor<Void>;
|
|
2941
|
-
export declare const getFloat32Mask: (x: number) => DataView;
|
|
2942
|
-
export declare const getFloat64Mask: (x: number) => DataView;
|
|
2943
|
-
export declare const getInt16Mask: (x: number) => DataView;
|
|
2944
|
-
export declare const getInt32Mask: (x: number) => DataView;
|
|
2945
|
-
export declare const getInt64Mask: (x: bigint) => DataView;
|
|
2946
|
-
export declare const getInt8Mask: (x: number) => DataView;
|
|
2947
|
-
export declare const getUint16Mask: (x: number) => DataView;
|
|
2948
|
-
export declare const getUint32Mask: (x: number) => DataView;
|
|
2949
|
-
export declare const getUint64Mask: (x: bigint) => DataView;
|
|
2950
|
-
export declare const getUint8Mask: (x: number) => DataView;
|
|
2951
|
-
export declare function getBitMask(value: boolean, bitOffset: number): DataView;
|
|
2952
|
-
/**
|
|
2953
|
-
* A class that manages Cap'n Proto RPC connections.
|
|
2954
|
-
*/
|
|
2955
|
-
export declare class CapnpRPC {
|
|
2956
|
-
protected acceptQueue: Deferred<Conn>[];
|
|
2957
|
-
protected connections: Record<number, Conn>;
|
|
2958
|
-
protected connectQueue: MessagePort$1[];
|
|
2959
|
-
/**
|
|
2960
|
-
* Creates a new {@link Conn} instance.
|
|
2961
|
-
*
|
|
2962
|
-
* @remarks
|
|
2963
|
-
* This class is used to manage connections and accept incoming connections using the {@link MessageChannel} API.
|
|
2964
|
-
*/
|
|
2965
|
-
connect(id?: number): Conn;
|
|
2966
|
-
/**
|
|
2967
|
-
* Accepts a connection from the connect queue.
|
|
2968
|
-
*
|
|
2969
|
-
* @returns A promise that resolves to a Conn instance when a connection is accepted.
|
|
2970
|
-
* @throws If no connections are available in the connect queue.
|
|
2971
|
-
*/
|
|
2972
|
-
accept(): Promise<Conn>;
|
|
2973
|
-
/**
|
|
2974
|
-
* Closes all connections and clears the queues.
|
|
2975
|
-
*
|
|
2976
|
-
* @remarks
|
|
2977
|
-
* This method will reject all pending accept promises and close all
|
|
2978
|
-
* connections in the connect queue.
|
|
2979
|
-
*/
|
|
2980
|
-
close(): void;
|
|
2981
|
-
}
|
|
2982
|
-
export declare class MessageChannelTransport extends DeferredTransport {
|
|
2983
|
-
port: MessagePort$1;
|
|
2984
|
-
constructor(port: MessagePort$1);
|
|
2985
|
-
close: () => void;
|
|
2986
|
-
sendMessage(msg: Message$1): void;
|
|
2987
|
-
}
|
|
2988
|
-
declare class Node_Parameter extends Struct {
|
|
2989
|
-
static readonly _capnp: {
|
|
2990
|
-
displayName: string;
|
|
2991
|
-
id: string;
|
|
2992
|
-
size: ObjectSize;
|
|
2993
|
-
};
|
|
2994
|
-
get name(): string;
|
|
2995
|
-
set name(value: string);
|
|
2996
|
-
toString(): string;
|
|
2997
|
-
}
|
|
2998
|
-
declare class Node_NestedNode extends Struct {
|
|
2882
|
+
declare class Node_Interface extends Struct {
|
|
2999
2883
|
static readonly _capnp: {
|
|
3000
2884
|
displayName: string;
|
|
3001
2885
|
id: string;
|
|
3002
2886
|
size: ObjectSize;
|
|
3003
2887
|
};
|
|
2888
|
+
static _Methods: ListCtor<Method$1>;
|
|
2889
|
+
static _Superclasses: ListCtor<Superclass>;
|
|
2890
|
+
_adoptMethods(value: Orphan<List<Method$1>>): void;
|
|
2891
|
+
_disownMethods(): Orphan<List<Method$1>>;
|
|
3004
2892
|
/**
|
|
3005
|
-
*
|
|
3006
|
-
*
|
|
3007
|
-
* (On Zooko's triangle, this is the node's petname according to its parent scope.)
|
|
2893
|
+
* Methods ordered by ordinal.
|
|
3008
2894
|
*
|
|
3009
2895
|
*/
|
|
3010
|
-
get
|
|
3011
|
-
|
|
2896
|
+
get methods(): List<Method$1>;
|
|
2897
|
+
_hasMethods(): boolean;
|
|
2898
|
+
_initMethods(length: number): List<Method$1>;
|
|
2899
|
+
set methods(value: List<Method$1>);
|
|
2900
|
+
_adoptSuperclasses(value: Orphan<List<Superclass>>): void;
|
|
2901
|
+
_disownSuperclasses(): Orphan<List<Superclass>>;
|
|
3012
2902
|
/**
|
|
3013
|
-
*
|
|
3014
|
-
* robust code should avoid relying on this.
|
|
2903
|
+
* Superclasses of this interface.
|
|
3015
2904
|
*
|
|
3016
2905
|
*/
|
|
3017
|
-
get
|
|
3018
|
-
|
|
2906
|
+
get superclasses(): List<Superclass>;
|
|
2907
|
+
_hasSuperclasses(): boolean;
|
|
2908
|
+
_initSuperclasses(length: number): List<Superclass>;
|
|
2909
|
+
set superclasses(value: List<Superclass>);
|
|
3019
2910
|
toString(): string;
|
|
3020
2911
|
}
|
|
3021
|
-
declare class
|
|
3022
|
-
static readonly _capnp: {
|
|
3023
|
-
displayName: string;
|
|
3024
|
-
id: string;
|
|
3025
|
-
size: ObjectSize;
|
|
3026
|
-
};
|
|
3027
|
-
/**
|
|
3028
|
-
* Doc comment on the member.
|
|
3029
|
-
*
|
|
3030
|
-
*/
|
|
3031
|
-
get docComment(): string;
|
|
3032
|
-
set docComment(value: string);
|
|
3033
|
-
toString(): string;
|
|
3034
|
-
}
|
|
3035
|
-
declare class Node_SourceInfo extends Struct {
|
|
3036
|
-
static readonly Member: typeof Node_SourceInfo_Member;
|
|
3037
|
-
static readonly _capnp: {
|
|
3038
|
-
displayName: string;
|
|
3039
|
-
id: string;
|
|
3040
|
-
size: ObjectSize;
|
|
3041
|
-
};
|
|
3042
|
-
static _Members: ListCtor<Node_SourceInfo_Member>;
|
|
3043
|
-
/**
|
|
3044
|
-
* ID of the Node which this info describes.
|
|
3045
|
-
*
|
|
3046
|
-
*/
|
|
3047
|
-
get id(): bigint;
|
|
3048
|
-
set id(value: bigint);
|
|
3049
|
-
/**
|
|
3050
|
-
* The top-level doc comment for the Node.
|
|
3051
|
-
*
|
|
3052
|
-
*/
|
|
3053
|
-
get docComment(): string;
|
|
3054
|
-
set docComment(value: string);
|
|
3055
|
-
_adoptMembers(value: Orphan<List<Node_SourceInfo_Member>>): void;
|
|
3056
|
-
_disownMembers(): Orphan<List<Node_SourceInfo_Member>>;
|
|
3057
|
-
/**
|
|
3058
|
-
* Information about each member -- i.e. fields (for structs), enumerants (for enums), or
|
|
3059
|
-
* methods (for interfaces).
|
|
3060
|
-
*
|
|
3061
|
-
* This list is the same length and order as the corresponding list in the Node, i.e.
|
|
3062
|
-
* Node.struct.fields, Node.enum.enumerants, or Node.interface.methods.
|
|
3063
|
-
*
|
|
3064
|
-
*/
|
|
3065
|
-
get members(): List<Node_SourceInfo_Member>;
|
|
3066
|
-
_hasMembers(): boolean;
|
|
3067
|
-
_initMembers(length: number): List<Node_SourceInfo_Member>;
|
|
3068
|
-
set members(value: List<Node_SourceInfo_Member>);
|
|
3069
|
-
toString(): string;
|
|
3070
|
-
}
|
|
3071
|
-
declare class Node_Struct extends Struct {
|
|
3072
|
-
static readonly _capnp: {
|
|
3073
|
-
displayName: string;
|
|
3074
|
-
id: string;
|
|
3075
|
-
size: ObjectSize;
|
|
3076
|
-
};
|
|
3077
|
-
static _Fields: ListCtor<Field>;
|
|
3078
|
-
/**
|
|
3079
|
-
* Size of the data section, in words.
|
|
3080
|
-
*
|
|
3081
|
-
*/
|
|
3082
|
-
get dataWordCount(): number;
|
|
3083
|
-
set dataWordCount(value: number);
|
|
3084
|
-
/**
|
|
3085
|
-
* Size of the pointer section, in pointers (which are one word each).
|
|
3086
|
-
*
|
|
3087
|
-
*/
|
|
3088
|
-
get pointerCount(): number;
|
|
3089
|
-
set pointerCount(value: number);
|
|
3090
|
-
/**
|
|
3091
|
-
* The preferred element size to use when encoding a list of this struct. If this is anything
|
|
3092
|
-
* other than `inlineComposite` then the struct is one word or less in size and is a candidate
|
|
3093
|
-
* for list packing optimization.
|
|
3094
|
-
*
|
|
3095
|
-
*/
|
|
3096
|
-
get preferredListEncoding(): ElementSize;
|
|
3097
|
-
set preferredListEncoding(value: ElementSize);
|
|
3098
|
-
/**
|
|
3099
|
-
* If true, then this "struct" node is actually not an independent node, but merely represents
|
|
3100
|
-
* some named union or group within a particular parent struct. This node's scopeId refers
|
|
3101
|
-
* to the parent struct, which may itself be a union/group in yet another struct.
|
|
3102
|
-
*
|
|
3103
|
-
* All group nodes share the same dataWordCount and pointerCount as the top-level
|
|
3104
|
-
* struct, and their fields live in the same ordinal and offset spaces as all other fields in
|
|
3105
|
-
* the struct.
|
|
3106
|
-
*
|
|
3107
|
-
* Note that a named union is considered a special kind of group -- in fact, a named union
|
|
3108
|
-
* is exactly equivalent to a group that contains nothing but an unnamed union.
|
|
3109
|
-
*
|
|
3110
|
-
*/
|
|
3111
|
-
get isGroup(): boolean;
|
|
3112
|
-
set isGroup(value: boolean);
|
|
3113
|
-
/**
|
|
3114
|
-
* Number of fields in this struct which are members of an anonymous union, and thus may
|
|
3115
|
-
* overlap. If this is non-zero, then a 16-bit discriminant is present indicating which
|
|
3116
|
-
* of the overlapping fields is active. This can never be 1 -- if it is non-zero, it must be
|
|
3117
|
-
* two or more.
|
|
3118
|
-
*
|
|
3119
|
-
* Note that the fields of an unnamed union are considered fields of the scope containing the
|
|
3120
|
-
* union -- an unnamed union is not its own group. So, a top-level struct may contain a
|
|
3121
|
-
* non-zero discriminant count. Named unions, on the other hand, are equivalent to groups
|
|
3122
|
-
* containing unnamed unions. So, a named union has its own independent schema node, with
|
|
3123
|
-
* `isGroup` = true.
|
|
3124
|
-
*
|
|
3125
|
-
*/
|
|
3126
|
-
get discriminantCount(): number;
|
|
3127
|
-
set discriminantCount(value: number);
|
|
3128
|
-
/**
|
|
3129
|
-
* If `discriminantCount` is non-zero, this is the offset of the union discriminant, in
|
|
3130
|
-
* multiples of 16 bits.
|
|
3131
|
-
*
|
|
3132
|
-
*/
|
|
3133
|
-
get discriminantOffset(): number;
|
|
3134
|
-
set discriminantOffset(value: number);
|
|
3135
|
-
_adoptFields(value: Orphan<List<Field>>): void;
|
|
3136
|
-
_disownFields(): Orphan<List<Field>>;
|
|
3137
|
-
/**
|
|
3138
|
-
* Fields defined within this scope (either the struct's top-level fields, or the fields of
|
|
3139
|
-
* a particular group; see `isGroup`).
|
|
3140
|
-
*
|
|
3141
|
-
* The fields are sorted by ordinal number, but note that because groups share the same
|
|
3142
|
-
* ordinal space, the field's index in this list is not necessarily exactly its ordinal.
|
|
3143
|
-
* On the other hand, the field's position in this list does remain the same even as the
|
|
3144
|
-
* protocol evolves, since it is not possible to insert or remove an earlier ordinal.
|
|
3145
|
-
* Therefore, for most use cases, if you want to identify a field by number, it may make the
|
|
3146
|
-
* most sense to use the field's index in this list rather than its ordinal.
|
|
3147
|
-
*
|
|
3148
|
-
*/
|
|
3149
|
-
get fields(): List<Field>;
|
|
3150
|
-
_hasFields(): boolean;
|
|
3151
|
-
_initFields(length: number): List<Field>;
|
|
3152
|
-
set fields(value: List<Field>);
|
|
3153
|
-
toString(): string;
|
|
3154
|
-
}
|
|
3155
|
-
declare class Node_Enum extends Struct {
|
|
3156
|
-
static readonly _capnp: {
|
|
3157
|
-
displayName: string;
|
|
3158
|
-
id: string;
|
|
3159
|
-
size: ObjectSize;
|
|
3160
|
-
};
|
|
3161
|
-
static _Enumerants: ListCtor<Enumerant>;
|
|
3162
|
-
_adoptEnumerants(value: Orphan<List<Enumerant>>): void;
|
|
3163
|
-
_disownEnumerants(): Orphan<List<Enumerant>>;
|
|
3164
|
-
/**
|
|
3165
|
-
* Enumerants ordered by numeric value (ordinal).
|
|
3166
|
-
*
|
|
3167
|
-
*/
|
|
3168
|
-
get enumerants(): List<Enumerant>;
|
|
3169
|
-
_hasEnumerants(): boolean;
|
|
3170
|
-
_initEnumerants(length: number): List<Enumerant>;
|
|
3171
|
-
set enumerants(value: List<Enumerant>);
|
|
3172
|
-
toString(): string;
|
|
3173
|
-
}
|
|
3174
|
-
declare class Node_Interface extends Struct {
|
|
3175
|
-
static readonly _capnp: {
|
|
3176
|
-
displayName: string;
|
|
3177
|
-
id: string;
|
|
3178
|
-
size: ObjectSize;
|
|
3179
|
-
};
|
|
3180
|
-
static _Methods: ListCtor<Method$1>;
|
|
3181
|
-
static _Superclasses: ListCtor<Superclass>;
|
|
3182
|
-
_adoptMethods(value: Orphan<List<Method$1>>): void;
|
|
3183
|
-
_disownMethods(): Orphan<List<Method$1>>;
|
|
3184
|
-
/**
|
|
3185
|
-
* Methods ordered by ordinal.
|
|
3186
|
-
*
|
|
3187
|
-
*/
|
|
3188
|
-
get methods(): List<Method$1>;
|
|
3189
|
-
_hasMethods(): boolean;
|
|
3190
|
-
_initMethods(length: number): List<Method$1>;
|
|
3191
|
-
set methods(value: List<Method$1>);
|
|
3192
|
-
_adoptSuperclasses(value: Orphan<List<Superclass>>): void;
|
|
3193
|
-
_disownSuperclasses(): Orphan<List<Superclass>>;
|
|
3194
|
-
/**
|
|
3195
|
-
* Superclasses of this interface.
|
|
3196
|
-
*
|
|
3197
|
-
*/
|
|
3198
|
-
get superclasses(): List<Superclass>;
|
|
3199
|
-
_hasSuperclasses(): boolean;
|
|
3200
|
-
_initSuperclasses(length: number): List<Superclass>;
|
|
3201
|
-
set superclasses(value: List<Superclass>);
|
|
3202
|
-
toString(): string;
|
|
3203
|
-
}
|
|
3204
|
-
declare class Node_Const extends Struct {
|
|
2912
|
+
declare class Node_Const extends Struct {
|
|
3205
2913
|
static readonly _capnp: {
|
|
3206
2914
|
displayName: string;
|
|
3207
2915
|
id: string;
|
|
@@ -4237,6 +3945,20 @@ declare const ElementSize: {
|
|
|
4237
3945
|
readonly INLINE_COMPOSITE: 7;
|
|
4238
3946
|
};
|
|
4239
3947
|
export type ElementSize = (typeof ElementSize)[keyof typeof ElementSize];
|
|
3948
|
+
declare class CapnpVersion extends Struct {
|
|
3949
|
+
static readonly _capnp: {
|
|
3950
|
+
displayName: string;
|
|
3951
|
+
id: string;
|
|
3952
|
+
size: ObjectSize;
|
|
3953
|
+
};
|
|
3954
|
+
get major(): number;
|
|
3955
|
+
set major(value: number);
|
|
3956
|
+
get minor(): number;
|
|
3957
|
+
set minor(value: number);
|
|
3958
|
+
get micro(): number;
|
|
3959
|
+
set micro(value: number);
|
|
3960
|
+
toString(): string;
|
|
3961
|
+
}
|
|
4240
3962
|
declare class CodeGeneratorRequest_RequestedFile_Import extends Struct {
|
|
4241
3963
|
static readonly _capnp: {
|
|
4242
3964
|
displayName: string;
|
|
@@ -4262,6 +3984,98 @@ declare class CodeGeneratorRequest_RequestedFile_Import extends Struct {
|
|
|
4262
3984
|
set name(value: string);
|
|
4263
3985
|
toString(): string;
|
|
4264
3986
|
}
|
|
3987
|
+
declare class CodeGeneratorRequest_RequestedFile extends Struct {
|
|
3988
|
+
static readonly Import: typeof CodeGeneratorRequest_RequestedFile_Import;
|
|
3989
|
+
static readonly _capnp: {
|
|
3990
|
+
displayName: string;
|
|
3991
|
+
id: string;
|
|
3992
|
+
size: ObjectSize;
|
|
3993
|
+
};
|
|
3994
|
+
static _Imports: ListCtor<CodeGeneratorRequest_RequestedFile_Import>;
|
|
3995
|
+
/**
|
|
3996
|
+
* ID of the file.
|
|
3997
|
+
*
|
|
3998
|
+
*/
|
|
3999
|
+
get id(): bigint;
|
|
4000
|
+
set id(value: bigint);
|
|
4001
|
+
/**
|
|
4002
|
+
* Name of the file as it appeared on the command-line (minus the src-prefix). You may use
|
|
4003
|
+
* this to decide where to write the output.
|
|
4004
|
+
*
|
|
4005
|
+
*/
|
|
4006
|
+
get filename(): string;
|
|
4007
|
+
set filename(value: string);
|
|
4008
|
+
_adoptImports(value: Orphan<List<CodeGeneratorRequest_RequestedFile_Import>>): void;
|
|
4009
|
+
_disownImports(): Orphan<List<CodeGeneratorRequest_RequestedFile_Import>>;
|
|
4010
|
+
/**
|
|
4011
|
+
* List of all imported paths seen in this file.
|
|
4012
|
+
*
|
|
4013
|
+
*/
|
|
4014
|
+
get imports(): List<CodeGeneratorRequest_RequestedFile_Import>;
|
|
4015
|
+
_hasImports(): boolean;
|
|
4016
|
+
_initImports(length: number): List<CodeGeneratorRequest_RequestedFile_Import>;
|
|
4017
|
+
set imports(value: List<CodeGeneratorRequest_RequestedFile_Import>);
|
|
4018
|
+
toString(): string;
|
|
4019
|
+
}
|
|
4020
|
+
declare class CodeGeneratorRequest extends Struct {
|
|
4021
|
+
static readonly RequestedFile: typeof CodeGeneratorRequest_RequestedFile;
|
|
4022
|
+
static readonly _capnp: {
|
|
4023
|
+
displayName: string;
|
|
4024
|
+
id: string;
|
|
4025
|
+
size: ObjectSize;
|
|
4026
|
+
};
|
|
4027
|
+
static _Nodes: ListCtor<Node>;
|
|
4028
|
+
static _SourceInfo: ListCtor<Node_SourceInfo>;
|
|
4029
|
+
static _RequestedFiles: ListCtor<CodeGeneratorRequest_RequestedFile>;
|
|
4030
|
+
_adoptCapnpVersion(value: Orphan<CapnpVersion>): void;
|
|
4031
|
+
_disownCapnpVersion(): Orphan<CapnpVersion>;
|
|
4032
|
+
/**
|
|
4033
|
+
* Version of the `capnp` executable. Generally, code generators should ignore this, but the code
|
|
4034
|
+
* generators that ship with `capnp` itself will print a warning if this mismatches since that
|
|
4035
|
+
* probably indicates something is misconfigured.
|
|
4036
|
+
*
|
|
4037
|
+
* The first version of 'capnp' to set this was 0.6.0. So, if it's missing, the compiler version
|
|
4038
|
+
* is older than that.
|
|
4039
|
+
*
|
|
4040
|
+
*/
|
|
4041
|
+
get capnpVersion(): CapnpVersion;
|
|
4042
|
+
_hasCapnpVersion(): boolean;
|
|
4043
|
+
_initCapnpVersion(): CapnpVersion;
|
|
4044
|
+
set capnpVersion(value: CapnpVersion);
|
|
4045
|
+
_adoptNodes(value: Orphan<List<Node>>): void;
|
|
4046
|
+
_disownNodes(): Orphan<List<Node>>;
|
|
4047
|
+
/**
|
|
4048
|
+
* All nodes parsed by the compiler, including for the files on the command line and their
|
|
4049
|
+
* imports.
|
|
4050
|
+
*
|
|
4051
|
+
*/
|
|
4052
|
+
get nodes(): List<Node>;
|
|
4053
|
+
_hasNodes(): boolean;
|
|
4054
|
+
_initNodes(length: number): List<Node>;
|
|
4055
|
+
set nodes(value: List<Node>);
|
|
4056
|
+
_adoptSourceInfo(value: Orphan<List<Node_SourceInfo>>): void;
|
|
4057
|
+
_disownSourceInfo(): Orphan<List<Node_SourceInfo>>;
|
|
4058
|
+
/**
|
|
4059
|
+
* Information about the original source code for each node, where available. This array may be
|
|
4060
|
+
* omitted or may be missing some nodes if no info is available for them.
|
|
4061
|
+
*
|
|
4062
|
+
*/
|
|
4063
|
+
get sourceInfo(): List<Node_SourceInfo>;
|
|
4064
|
+
_hasSourceInfo(): boolean;
|
|
4065
|
+
_initSourceInfo(length: number): List<Node_SourceInfo>;
|
|
4066
|
+
set sourceInfo(value: List<Node_SourceInfo>);
|
|
4067
|
+
_adoptRequestedFiles(value: Orphan<List<CodeGeneratorRequest_RequestedFile>>): void;
|
|
4068
|
+
_disownRequestedFiles(): Orphan<List<CodeGeneratorRequest_RequestedFile>>;
|
|
4069
|
+
/**
|
|
4070
|
+
* Files which were listed on the command line.
|
|
4071
|
+
*
|
|
4072
|
+
*/
|
|
4073
|
+
get requestedFiles(): List<CodeGeneratorRequest_RequestedFile>;
|
|
4074
|
+
_hasRequestedFiles(): boolean;
|
|
4075
|
+
_initRequestedFiles(length: number): List<CodeGeneratorRequest_RequestedFile>;
|
|
4076
|
+
set requestedFiles(value: List<CodeGeneratorRequest_RequestedFile>);
|
|
4077
|
+
toString(): string;
|
|
4078
|
+
}
|
|
4265
4079
|
export interface CodeGeneratorFileContext {
|
|
4266
4080
|
readonly nodes: Node[];
|
|
4267
4081
|
readonly imports: CodeGeneratorRequest_RequestedFile_Import[];
|
|
@@ -4295,13 +4109,368 @@ export interface CapnpcCLIOptions {
|
|
|
4295
4109
|
workspaceRoot: string;
|
|
4296
4110
|
tty?: boolean;
|
|
4297
4111
|
}
|
|
4298
|
-
export type CapnpcOptions = Omit<CapnpcCLIOptions, "
|
|
4112
|
+
export type CapnpcOptions = Omit<CapnpcCLIOptions, "tsconfig" | "schema"> & {
|
|
4113
|
+
schemas: string | string[];
|
|
4114
|
+
} & ({
|
|
4299
4115
|
tsconfig: ParsedCommandLine;
|
|
4116
|
+
tsconfigPath?: string;
|
|
4117
|
+
} | {
|
|
4118
|
+
tsconfig?: ParsedCommandLine;
|
|
4119
|
+
tsconfigPath: string;
|
|
4120
|
+
});
|
|
4121
|
+
export type CapnpcResolvedOptions = Omit<CapnpcOptions, "noTs" | "noDts"> & {
|
|
4300
4122
|
schemas: string[];
|
|
4123
|
+
tsconfig: ParsedCommandLine;
|
|
4301
4124
|
};
|
|
4302
4125
|
export interface CapnpcResult {
|
|
4303
4126
|
ctx: CodeGeneratorContext;
|
|
4304
4127
|
files: Map<string, string>;
|
|
4305
4128
|
}
|
|
4129
|
+
/**
|
|
4130
|
+
* Compiles Cap'n Proto schemas into TypeScript files.
|
|
4131
|
+
*
|
|
4132
|
+
* @param options - The options for the compilation process.
|
|
4133
|
+
* @returns A promise that resolves to the compilation result.
|
|
4134
|
+
*/
|
|
4135
|
+
export declare function capnpc(options: CapnpcResolvedOptions): Promise<CapnpcResult>;
|
|
4136
|
+
/**
|
|
4137
|
+
* Compiles Cap'n Proto schemas into TypeScript files.
|
|
4138
|
+
*
|
|
4139
|
+
* @param dataBuf - The buffer containing the Cap'n Proto schema data.
|
|
4140
|
+
* @param options - The options for the compilation process.
|
|
4141
|
+
* @returns A promise that resolves to the compilation result.
|
|
4142
|
+
*/
|
|
4143
|
+
export declare function compile(dataBuf: Buffer, options: CapnpcOptions): Promise<{
|
|
4144
|
+
ctx: {
|
|
4145
|
+
files: {
|
|
4146
|
+
readonly req: CodeGeneratorRequest;
|
|
4147
|
+
readonly file: CodeGeneratorRequest_RequestedFile;
|
|
4148
|
+
readonly nodes: Node[];
|
|
4149
|
+
readonly imports: CodeGeneratorRequest_RequestedFile_Import[];
|
|
4150
|
+
concreteLists: Array<[
|
|
4151
|
+
string,
|
|
4152
|
+
Field
|
|
4153
|
+
]>;
|
|
4154
|
+
generatedNodeIds: Set<string>;
|
|
4155
|
+
generatedResultsPromiseIds: Set<bigint>;
|
|
4156
|
+
tsPath: string;
|
|
4157
|
+
codeParts: string[];
|
|
4158
|
+
toString(): string;
|
|
4159
|
+
}[];
|
|
4160
|
+
};
|
|
4161
|
+
files: Map<string, string>;
|
|
4162
|
+
} | undefined>;
|
|
4163
|
+
declare class PipelineClient<AnswerResults extends Struct, ParentResults extends Struct, Results extends Struct> implements Client {
|
|
4164
|
+
pipeline: Pipeline<AnswerResults, ParentResults, Results>;
|
|
4165
|
+
constructor(pipeline: Pipeline<AnswerResults, ParentResults, Results>);
|
|
4166
|
+
transform(): PipelineOp[];
|
|
4167
|
+
call<CallParams extends Struct, CallResults extends Struct>(call: Call<CallParams, CallResults>): Answer<CallResults>;
|
|
4168
|
+
close(): void;
|
|
4169
|
+
}
|
|
4170
|
+
/**
|
|
4171
|
+
* A Pipeline is a generic wrapper for an answer
|
|
4172
|
+
*/
|
|
4173
|
+
export declare class Pipeline<AnswerResults extends Struct, ParentResults extends Struct, Results extends Struct> {
|
|
4174
|
+
ResultsClass: StructCtor<Results>;
|
|
4175
|
+
answer: Answer<AnswerResults>;
|
|
4176
|
+
parent?: Pipeline<AnswerResults, Struct, ParentResults> | undefined;
|
|
4177
|
+
op: PipelineOp;
|
|
4178
|
+
pipelineClient?: PipelineClient<AnswerResults, ParentResults, Results>;
|
|
4179
|
+
constructor(ResultsClass: StructCtor<Results>, answer: Answer<AnswerResults>, op?: PipelineOp, parent?: Pipeline<AnswerResults, Struct, ParentResults> | undefined);
|
|
4180
|
+
transform(): PipelineOp[];
|
|
4181
|
+
struct(): Promise<Results>;
|
|
4182
|
+
client(): PipelineClient<AnswerResults, ParentResults, Results>;
|
|
4183
|
+
getPipeline<RR extends Struct>(ResultsClass: StructCtor<RR>, off: number, defaultValue?: Pointer): Pipeline<AnswerResults, Results, RR>;
|
|
4184
|
+
}
|
|
4185
|
+
export declare abstract class DeferredTransport implements Transport {
|
|
4186
|
+
protected d?: Deferred<Message$1>;
|
|
4187
|
+
protected closed: boolean;
|
|
4188
|
+
abstract sendMessage(msg: Message$1): void;
|
|
4189
|
+
close(): void;
|
|
4190
|
+
recvMessage(): Promise<Message$1>;
|
|
4191
|
+
protected reject: (err: unknown) => void;
|
|
4192
|
+
protected resolve: (buf: ArrayBuffer) => void;
|
|
4193
|
+
}
|
|
4194
|
+
export declare class ErrorClient implements Client {
|
|
4195
|
+
err: Error;
|
|
4196
|
+
constructor(err: Error);
|
|
4197
|
+
call<P extends Struct, R extends Struct>(_call: Call<P, R>): Answer<R>;
|
|
4198
|
+
close(): void;
|
|
4199
|
+
}
|
|
4200
|
+
export declare function clientOrNull(client: Client | null): Client;
|
|
4201
|
+
export interface InterfaceDefinition {
|
|
4202
|
+
methods: Array<Method<any, any>>;
|
|
4203
|
+
}
|
|
4204
|
+
export declare class Registry {
|
|
4205
|
+
static readonly interfaces: Map<bigint, InterfaceDefinition>;
|
|
4206
|
+
static register(id: bigint, def: InterfaceDefinition): void;
|
|
4207
|
+
static lookup(id: bigint): InterfaceDefinition | undefined;
|
|
4208
|
+
}
|
|
4209
|
+
export declare class Text extends List<string> {
|
|
4210
|
+
static fromPointer(pointer: Pointer): Text;
|
|
4211
|
+
/**
|
|
4212
|
+
* Read a utf-8 encoded string value from this pointer.
|
|
4213
|
+
*
|
|
4214
|
+
* @param index The index at which to start reading; defaults to zero.
|
|
4215
|
+
* @returns The string value.
|
|
4216
|
+
*/
|
|
4217
|
+
get(index?: number): string;
|
|
4218
|
+
/**
|
|
4219
|
+
* Get the number of utf-8 encoded bytes in this text. This does **not** include the NUL byte.
|
|
4220
|
+
*
|
|
4221
|
+
* @returns The number of bytes allocated for the text.
|
|
4222
|
+
*/
|
|
4223
|
+
get length(): number;
|
|
4224
|
+
/**
|
|
4225
|
+
* Write a utf-8 encoded string value starting at the specified index.
|
|
4226
|
+
*
|
|
4227
|
+
* @param index The index at which to start copying the string. Note that if this is not zero the bytes
|
|
4228
|
+
* before `index` will be left as-is. All bytes after `index` will be overwritten.
|
|
4229
|
+
* @param value The string value to set.
|
|
4230
|
+
*/
|
|
4231
|
+
set(index: number, value: string): void;
|
|
4232
|
+
toString(): string;
|
|
4233
|
+
toJSON(): string;
|
|
4234
|
+
[Symbol.toPrimitive](): string;
|
|
4235
|
+
[Symbol.toStringTag](): string;
|
|
4236
|
+
}
|
|
4237
|
+
export declare class Void extends Struct {
|
|
4238
|
+
static readonly _capnp: _StructCtor;
|
|
4239
|
+
}
|
|
4240
|
+
declare function initStruct(size: ObjectSize, s: Struct): void;
|
|
4241
|
+
declare function initStructAt<T extends Struct>(index: number, StructClass: StructCtor<T>, p: Pointer): T;
|
|
4242
|
+
declare function checkPointerBounds(index: number, s: Struct): void;
|
|
4243
|
+
declare function getInterfaceClientOrNullAt(index: number, s: Struct): Client;
|
|
4244
|
+
declare function getInterfaceClientOrNull(p: Pointer): Client;
|
|
4245
|
+
declare function resize(dstSize: ObjectSize, s: Struct): void;
|
|
4246
|
+
declare function getAs<T extends Struct>(StructClass: StructCtor<T>, s: Struct): T;
|
|
4247
|
+
declare function getBit(bitOffset: number, s: Struct, defaultMask?: DataView): boolean;
|
|
4248
|
+
declare function getData(index: number, s: Struct, defaultValue?: Pointer): Data;
|
|
4249
|
+
declare function getDataSection(s: Struct): Pointer;
|
|
4250
|
+
declare function getFloat32(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4251
|
+
declare function getFloat64(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4252
|
+
declare function getInt16(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4253
|
+
declare function getInt32(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4254
|
+
declare function getInt64(byteOffset: number, s: Struct, defaultMask?: DataView): bigint;
|
|
4255
|
+
declare function getInt8(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4256
|
+
declare function getList<T>(index: number, ListClass: ListCtor<T>, s: Struct, defaultValue?: Pointer): List<T>;
|
|
4257
|
+
declare function getPointer(index: number, s: Struct): Pointer;
|
|
4258
|
+
declare function getPointerAs<T extends Pointer>(index: number, PointerClass: PointerCtor<T>, s: Struct): T;
|
|
4259
|
+
declare function getPointerSection(s: Struct): Pointer;
|
|
4260
|
+
declare function getSize(s: Struct): ObjectSize;
|
|
4261
|
+
declare function getStruct<T extends Struct>(index: number, StructClass: StructCtor<T>, s: Struct, defaultValue?: Pointer): T;
|
|
4262
|
+
declare function getText(index: number, s: Struct, defaultValue?: string): string;
|
|
4263
|
+
declare function getUint16(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4264
|
+
declare function getUint32(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4265
|
+
declare function getUint64(byteOffset: number, s: Struct, defaultMask?: DataView): bigint;
|
|
4266
|
+
declare function getUint8(byteOffset: number, s: Struct, defaultMask?: DataView): number;
|
|
4267
|
+
declare function initData(index: number, length: number, s: Struct): Data;
|
|
4268
|
+
declare function initList<T>(index: number, ListClass: ListCtor<T>, length: number, s: Struct): List<T>;
|
|
4269
|
+
declare function setBit(bitOffset: number, value: boolean, s: Struct, defaultMask?: DataView): void;
|
|
4270
|
+
declare function setFloat32(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4271
|
+
declare function setFloat64(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4272
|
+
declare function setInt16(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4273
|
+
declare function setInt32(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4274
|
+
declare function setInt64(byteOffset: number, value: bigint, s: Struct, defaultMask?: DataView): void;
|
|
4275
|
+
declare function setInt8(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4276
|
+
declare function setText(index: number, value: string, s: Struct): void;
|
|
4277
|
+
declare function setUint16(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4278
|
+
declare function setUint32(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4279
|
+
declare function setUint64(byteOffset: number, value: bigint, s: Struct, defaultMask?: DataView): void;
|
|
4280
|
+
declare function setUint8(byteOffset: number, value: number, s: Struct, defaultMask?: DataView): void;
|
|
4281
|
+
declare function testWhich(name: string, found: number, wanted: number, s: Struct): void;
|
|
4282
|
+
declare function checkDataBounds(byteOffset: number, byteLength: number, s: Struct): void;
|
|
4283
|
+
declare function adopt<T extends Pointer>(src: Orphan<T>, p: T): void;
|
|
4284
|
+
declare function disown<T extends Pointer>(p: T): Orphan<T>;
|
|
4285
|
+
declare function dump$1(p: Pointer): string;
|
|
4286
|
+
declare function getListByteLength(elementSize: ListElementSize, length: number, compositeSize?: ObjectSize): number;
|
|
4287
|
+
declare function getListElementByteLength(elementSize: ListElementSize): number;
|
|
4288
|
+
declare function add(offset: number, p: Pointer): Pointer;
|
|
4289
|
+
declare function copyFrom(src: Pointer, p: Pointer): void;
|
|
4290
|
+
declare function erase(p: Pointer): void;
|
|
4291
|
+
declare function erasePointer(p: Pointer): void;
|
|
4292
|
+
declare function followFar(p: Pointer): Pointer;
|
|
4293
|
+
declare function followFars(p: Pointer): Pointer;
|
|
4294
|
+
declare function getCapabilityId(p: Pointer): number;
|
|
4295
|
+
declare function getContent(p: Pointer, ignoreCompositeIndex?: boolean): Pointer;
|
|
4296
|
+
declare function getFarSegmentId(p: Pointer): number;
|
|
4297
|
+
declare function getListElementSize(p: Pointer): ListElementSize;
|
|
4298
|
+
declare function getListLength(p: Pointer): number;
|
|
4299
|
+
declare function getOffsetWords(p: Pointer): number;
|
|
4300
|
+
declare function getPointerType(p: Pointer): PointerType;
|
|
4301
|
+
declare function getStructDataWords(p: Pointer): number;
|
|
4302
|
+
declare function getStructPointerLength(p: Pointer): number;
|
|
4303
|
+
declare function getStructSize(p: Pointer): ObjectSize;
|
|
4304
|
+
declare function getTargetCompositeListTag(p: Pointer): Pointer;
|
|
4305
|
+
declare function getTargetCompositeListSize(p: Pointer): ObjectSize;
|
|
4306
|
+
declare function getTargetListElementSize(p: Pointer): ListElementSize;
|
|
4307
|
+
declare function getTargetListLength(p: Pointer): number;
|
|
4308
|
+
declare function getTargetPointerType(p: Pointer): PointerType;
|
|
4309
|
+
declare function getTargetStructSize(p: Pointer): ObjectSize;
|
|
4310
|
+
declare function initPointer(contentSegment: Segment, contentOffset: number, p: Pointer): PointerAllocationResult;
|
|
4311
|
+
declare function isDoubleFar(p: Pointer): boolean;
|
|
4312
|
+
declare function isNull(p: Pointer): boolean;
|
|
4313
|
+
declare function relocateTo(dst: Pointer, src: Pointer): void;
|
|
4314
|
+
declare function setFarPointer(doubleFar: boolean, offsetWords: number, segmentId: number, p: Pointer): void;
|
|
4315
|
+
declare function setInterfacePointer(capId: number, p: Pointer): void;
|
|
4316
|
+
declare function getInterfacePointer(p: Pointer): number;
|
|
4317
|
+
declare function setListPointer(offsetWords: number, size: ListElementSize, length: number, p: Pointer, compositeSize?: ObjectSize): void;
|
|
4318
|
+
declare function setStructPointer(offsetWords: number, size: ObjectSize, p: Pointer): void;
|
|
4319
|
+
declare function validate(pointerType: PointerType, p: Pointer, elementSize?: ListElementSize): void;
|
|
4320
|
+
declare function copyFromInterface(src: Pointer, dst: Pointer): void;
|
|
4321
|
+
declare function copyFromList(src: Pointer, dst: Pointer): void;
|
|
4322
|
+
declare function copyFromStruct(src: Pointer, dst: Pointer): void;
|
|
4323
|
+
declare function trackPointerAllocation(message: Message, p: Pointer): void;
|
|
4324
|
+
declare class PointerAllocationResult {
|
|
4325
|
+
readonly pointer: Pointer;
|
|
4326
|
+
readonly offsetWords: number;
|
|
4327
|
+
constructor(pointer: Pointer, offsetWords: number);
|
|
4328
|
+
}
|
|
4329
|
+
export declare namespace utils {
|
|
4330
|
+
export { PointerAllocationResult, add, adopt, checkDataBounds, checkPointerBounds, copyFrom, copyFromInterface, copyFromList, copyFromStruct, disown, dump$1, erase, erasePointer, followFar, followFars, getAs, getBit, getCapabilityId, getContent, getData, getDataSection, getFarSegmentId, getFloat32, getFloat64, getInt16, getInt32, getInt64, getInt8, getInterfaceClientOrNull, getInterfaceClientOrNullAt, getInterfacePointer, getList, getListByteLength, getListElementByteLength, getListElementSize, getListLength, getOffsetWords, getPointer, getPointerAs, getPointerSection, getPointerType, getSize, getStruct, getStructDataWords, getStructPointerLength, getStructSize, getTargetCompositeListSize, getTargetCompositeListTag, getTargetListElementSize, getTargetListLength, getTargetPointerType, getTargetStructSize, getText, getUint16, getUint32, getUint64, getUint8, initData, initList, initPointer, initStruct, initStructAt, isDoubleFar, isNull, relocateTo, resize, setBit, setFarPointer, setFloat32, setFloat64, setInt16, setInt32, setInt64, setInt8, setInterfacePointer, setListPointer, setStructPointer, setText, setUint16, setUint32, setUint64, setUint8, testWhich, trackPointerAllocation, validate };
|
|
4331
|
+
}
|
|
4332
|
+
export declare const AnyPointerList: ListCtor<Pointer>;
|
|
4333
|
+
export declare class BoolList extends List<boolean> {
|
|
4334
|
+
static readonly _capnp: _ListCtor;
|
|
4335
|
+
get(index: number): boolean;
|
|
4336
|
+
set(index: number, value: boolean): void;
|
|
4337
|
+
[Symbol.toStringTag](): string;
|
|
4338
|
+
}
|
|
4339
|
+
export declare function CompositeList<T extends Struct>(CompositeClass: StructCtor<T>): ListCtor<T>;
|
|
4340
|
+
export declare const DataList: ListCtor<Data>;
|
|
4341
|
+
export declare class Float32List extends List<number> {
|
|
4342
|
+
static readonly _capnp: _ListCtor;
|
|
4343
|
+
get(index: number): number;
|
|
4344
|
+
set(index: number, value: number): void;
|
|
4345
|
+
[Symbol.toStringTag](): string;
|
|
4346
|
+
}
|
|
4347
|
+
export declare class Float64List extends List<number> {
|
|
4348
|
+
static readonly _capnp: _ListCtor;
|
|
4349
|
+
get(index: number): number;
|
|
4350
|
+
set(index: number, value: number): void;
|
|
4351
|
+
[Symbol.toStringTag](): string;
|
|
4352
|
+
}
|
|
4353
|
+
export declare class Int8List extends List<number> {
|
|
4354
|
+
static readonly _capnp: _ListCtor;
|
|
4355
|
+
get(index: number): number;
|
|
4356
|
+
set(index: number, value: number): void;
|
|
4357
|
+
[Symbol.toStringTag](): string;
|
|
4358
|
+
}
|
|
4359
|
+
export declare class Int16List extends List<number> {
|
|
4360
|
+
static readonly _capnp: _ListCtor;
|
|
4361
|
+
get(index: number): number;
|
|
4362
|
+
set(index: number, value: number): void;
|
|
4363
|
+
[Symbol.toStringTag](): string;
|
|
4364
|
+
}
|
|
4365
|
+
export declare class Int32List extends List<number> {
|
|
4366
|
+
static readonly _capnp: _ListCtor;
|
|
4367
|
+
get(index: number): number;
|
|
4368
|
+
set(index: number, value: number): void;
|
|
4369
|
+
[Symbol.toStringTag](): string;
|
|
4370
|
+
}
|
|
4371
|
+
export declare class Int64List extends List<bigint> {
|
|
4372
|
+
static readonly _capnp: _ListCtor;
|
|
4373
|
+
get(index: number): bigint;
|
|
4374
|
+
set(index: number, value: bigint): void;
|
|
4375
|
+
[Symbol.toStringTag](): string;
|
|
4376
|
+
}
|
|
4377
|
+
export declare const InterfaceList: ListCtor<Interface>;
|
|
4378
|
+
export declare function PointerList<T extends Pointer>(PointerClass: PointerCtor<T>): ListCtor<T>;
|
|
4379
|
+
export declare class TextList extends List<string> {
|
|
4380
|
+
static readonly _capnp: _ListCtor;
|
|
4381
|
+
get(index: number): string;
|
|
4382
|
+
set(index: number, value: string): void;
|
|
4383
|
+
[Symbol.toStringTag](): string;
|
|
4384
|
+
}
|
|
4385
|
+
export declare class Uint8List extends List<number> {
|
|
4386
|
+
static readonly _capnp: _ListCtor;
|
|
4387
|
+
get(index: number): number;
|
|
4388
|
+
set(index: number, value: number): void;
|
|
4389
|
+
[Symbol.toStringTag](): string;
|
|
4390
|
+
}
|
|
4391
|
+
export declare class Uint16List extends List<number> {
|
|
4392
|
+
static readonly _capnp: _ListCtor;
|
|
4393
|
+
get(index: number): number;
|
|
4394
|
+
set(index: number, value: number): void;
|
|
4395
|
+
[Symbol.toStringTag](): string;
|
|
4396
|
+
}
|
|
4397
|
+
export declare class Uint32List extends List<number> {
|
|
4398
|
+
static readonly _capnp: _ListCtor;
|
|
4399
|
+
get(index: number): number;
|
|
4400
|
+
set(index: number, value: number): void;
|
|
4401
|
+
[Symbol.toStringTag](): string;
|
|
4402
|
+
}
|
|
4403
|
+
export declare class Uint64List extends List<bigint> {
|
|
4404
|
+
static readonly _capnp: _ListCtor;
|
|
4405
|
+
get(index: number): bigint;
|
|
4406
|
+
set(index: number, value: bigint): void;
|
|
4407
|
+
[Symbol.toStringTag](): string;
|
|
4408
|
+
}
|
|
4409
|
+
export declare const VoidList: ListCtor<Void>;
|
|
4410
|
+
export declare const getFloat32Mask: (x: number) => DataView;
|
|
4411
|
+
export declare const getFloat64Mask: (x: number) => DataView;
|
|
4412
|
+
export declare const getInt16Mask: (x: number) => DataView;
|
|
4413
|
+
export declare const getInt32Mask: (x: number) => DataView;
|
|
4414
|
+
export declare const getInt64Mask: (x: bigint) => DataView;
|
|
4415
|
+
export declare const getInt8Mask: (x: number) => DataView;
|
|
4416
|
+
export declare const getUint16Mask: (x: number) => DataView;
|
|
4417
|
+
export declare const getUint32Mask: (x: number) => DataView;
|
|
4418
|
+
export declare const getUint64Mask: (x: bigint) => DataView;
|
|
4419
|
+
export declare const getUint8Mask: (x: number) => DataView;
|
|
4420
|
+
export declare function getBitMask(value: boolean, bitOffset: number): DataView;
|
|
4421
|
+
export declare class MessageChannelTransport extends DeferredTransport {
|
|
4422
|
+
port: MessagePort$1;
|
|
4423
|
+
constructor(port: MessagePort$1);
|
|
4424
|
+
close: () => void;
|
|
4425
|
+
sendMessage(msg: Message$1): void;
|
|
4426
|
+
}
|
|
4427
|
+
/**
|
|
4428
|
+
* A class that manages Cap'n Proto RPC connections.
|
|
4429
|
+
*/
|
|
4430
|
+
export declare class CapnpRPC {
|
|
4431
|
+
/**
|
|
4432
|
+
* A queue for deferred connections that are waiting to be accepted.
|
|
4433
|
+
*
|
|
4434
|
+
* @remarks
|
|
4435
|
+
* This is used to manage incoming connections when the accept method is called.
|
|
4436
|
+
*/
|
|
4437
|
+
protected acceptQueue: Deferred<Conn>[];
|
|
4438
|
+
/**
|
|
4439
|
+
* A map of connections by their ID.
|
|
4440
|
+
*
|
|
4441
|
+
* @remarks
|
|
4442
|
+
* This is used to manage multiple connections and allows for easy retrieval by ID.
|
|
4443
|
+
*/
|
|
4444
|
+
protected connections: Record<number, Conn>;
|
|
4445
|
+
/**
|
|
4446
|
+
* A queue for connections that are waiting to be accepted.
|
|
4447
|
+
*
|
|
4448
|
+
* @remarks
|
|
4449
|
+
* This is used to manage incoming connections when the accept method is called.
|
|
4450
|
+
*/
|
|
4451
|
+
protected connectQueue: MessagePort$1[];
|
|
4452
|
+
/**
|
|
4453
|
+
* Creates a new {@link Conn} instance.
|
|
4454
|
+
*
|
|
4455
|
+
* @remarks
|
|
4456
|
+
* This class is used to manage connections and accept incoming connections using the {@link MessageChannel} API.
|
|
4457
|
+
*/
|
|
4458
|
+
connect(id?: number): Conn;
|
|
4459
|
+
/**
|
|
4460
|
+
* Accepts a connection from the connect queue.
|
|
4461
|
+
*
|
|
4462
|
+
* @returns A promise that resolves to a Conn instance when a connection is accepted.
|
|
4463
|
+
* @throws If no connections are available in the connect queue.
|
|
4464
|
+
*/
|
|
4465
|
+
accept(): Promise<Conn>;
|
|
4466
|
+
/**
|
|
4467
|
+
* Closes all connections and clears the queues.
|
|
4468
|
+
*
|
|
4469
|
+
* @remarks
|
|
4470
|
+
* This method will reject all pending accept promises and close all
|
|
4471
|
+
* connections in the connect queue.
|
|
4472
|
+
*/
|
|
4473
|
+
close(): void;
|
|
4474
|
+
}
|
|
4306
4475
|
|
|
4307
4476
|
export {};
|