@firestore-emulator/server
Version:
This package is the implementation of the Firestore emulator. It is a Node.js
204 lines • 8.51 kB
TypeScript
import type { Value as v1Value } from "@firestore-emulator/proto/dist/google/firestore/v1/document";
export type ValueObjectType = ReturnType<typeof v1Value.prototype.toObject>;
export interface FirestoreStateDocumentBaseField {
eq(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
toJSON(): {
type: string;
value: unknown;
};
toV1ValueObject(): ValueObjectType;
}
export declare class FirestoreStateDocumentStringField implements FirestoreStateDocumentBaseField {
readonly value: string;
type: "string_value";
constructor(value: string);
toJSON(): {
type: "string_value";
value: string;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentNullField implements FirestoreStateDocumentBaseField {
type: "null_value";
value: null;
toJSON(): {
readonly type: "null_value";
readonly value: null;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(_other: FirestoreStateDocumentFields): boolean;
lte(_other: FirestoreStateDocumentFields): boolean;
gt(_other: FirestoreStateDocumentFields): boolean;
gte(_other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentBooleanField implements FirestoreStateDocumentBaseField {
readonly value: boolean;
type: "boolean_value";
constructor(value: boolean);
toJSON(): {
type: "boolean_value";
value: boolean;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(_other: FirestoreStateDocumentFields): boolean;
lte(_other: FirestoreStateDocumentFields): boolean;
gt(_other: FirestoreStateDocumentFields): boolean;
gte(_other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentIntegerField implements FirestoreStateDocumentBaseField {
readonly value: number;
type: "integer_value";
constructor(value: number);
toJSON(): {
type: "integer_value";
value: number;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
add(other: FirestoreStateDocumentIntegerField): FirestoreStateDocumentIntegerField;
add(other: FirestoreStateDocumentDoubleField): FirestoreStateDocumentDoubleField;
}
export declare class FirestoreStateDocumentDoubleField implements FirestoreStateDocumentBaseField {
readonly value: number;
type: "double_value";
constructor(value: number);
toJSON(): {
type: "double_value";
value: number;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
add(other: FirestoreStateDocumentIntegerField | FirestoreStateDocumentDoubleField): FirestoreStateDocumentDoubleField;
}
export declare class FirestoreStateDocumentTimestampField implements FirestoreStateDocumentBaseField {
readonly value: {
nanos: number;
seconds: number;
};
type: "timestamp_value";
constructor(value: {
nanos: number;
seconds: number;
});
static fromDate(date: Date): FirestoreStateDocumentTimestampField;
toJSON(): {
readonly type: "timestamp_value";
readonly value: {
nanos: number;
seconds: number;
};
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentBytesField implements FirestoreStateDocumentBaseField {
readonly value: Uint8Array;
type: "bytes_value";
constructor(value: Uint8Array);
toJSON(): {
readonly type: "bytes_value";
readonly value: Uint8Array<ArrayBufferLike>;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentReferenceField implements FirestoreStateDocumentBaseField {
readonly value: string;
type: "reference_value";
constructor(value: string);
toJSON(): {
type: "reference_value";
value: string;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(_other: FirestoreStateDocumentFields): boolean;
lte(_other: FirestoreStateDocumentFields): boolean;
gt(_other: FirestoreStateDocumentFields): boolean;
gte(_other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentGeoPointField implements FirestoreStateDocumentBaseField {
readonly value: {
latitude: number;
longitude: number;
};
type: "geo_point_value";
constructor(value: {
latitude: number;
longitude: number;
});
toJSON(): {
type: "geo_point_value";
value: {
latitude: number;
longitude: number;
};
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(other: FirestoreStateDocumentFields): boolean;
lte(other: FirestoreStateDocumentFields): boolean;
gt(other: FirestoreStateDocumentFields): boolean;
gte(other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentArrayField implements FirestoreStateDocumentBaseField {
readonly value: FirestoreStateDocumentFields[];
type: "array_value";
constructor(value: FirestoreStateDocumentFields[]);
toJSON(): {
type: string;
value: unknown;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(_other: FirestoreStateDocumentFields): boolean;
lte(_other: FirestoreStateDocumentFields): boolean;
gt(_other: FirestoreStateDocumentFields): boolean;
gte(_other: FirestoreStateDocumentFields): boolean;
}
export declare class FirestoreStateDocumentMapField implements FirestoreStateDocumentBaseField {
readonly value: Record<string, FirestoreStateDocumentFields>;
type: "map_value";
constructor(value: Record<string, FirestoreStateDocumentFields>);
toJSON(): {
type: string;
value: unknown;
};
toV1ValueObject(): ValueObjectType;
eq(other: FirestoreStateDocumentFields): boolean;
lt(_other: FirestoreStateDocumentFields): boolean;
lte(_other: FirestoreStateDocumentFields): boolean;
gt(_other: FirestoreStateDocumentFields): boolean;
gte(_other: FirestoreStateDocumentFields): boolean;
}
export type FirestoreStateDocumentFields = FirestoreStateDocumentStringField | FirestoreStateDocumentNullField | FirestoreStateDocumentBooleanField | FirestoreStateDocumentIntegerField | FirestoreStateDocumentDoubleField | FirestoreStateDocumentTimestampField | FirestoreStateDocumentBytesField | FirestoreStateDocumentReferenceField | FirestoreStateDocumentGeoPointField | FirestoreStateDocumentArrayField | FirestoreStateDocumentMapField;
export declare const convertV1DocumentField: (field: v1Value) => FirestoreStateDocumentFields;
export declare const convertV1Value: (value: v1Value) => ReturnType<typeof v1Value.prototype.toObject>;
//# sourceMappingURL=field.d.ts.map