@spica-devkit/bucket 0.18.9 → 0.18.11

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.
@@ -1,44 +0,0 @@
1
- import { JSONSchema7, JSONSchema7TypeName } from "json-schema";
2
- import { Observable } from "rxjs";
3
- export interface Bucket {
4
- _id?: string;
5
- title: string;
6
- icon?: string;
7
- description: string;
8
- primary: string;
9
- history?: boolean;
10
- properties: {
11
- [key: string]: JSONSchema7 & PropertyOptions;
12
- };
13
- order?: number;
14
- }
15
- interface PropertyOptions {
16
- type: JSONSchema7TypeName | JSONSchema7TypeName[] | string;
17
- options: {
18
- translate?: boolean;
19
- history?: boolean;
20
- };
21
- }
22
- export interface BucketDocument {
23
- _id?: string;
24
- [key: string]: any | undefined;
25
- }
26
- export type RealtimeConnection<T> = Observable<T> & {
27
- insert: (document: Omit<Singular<T>, "_id">) => void;
28
- replace: (document: Singular<T> & {
29
- _id: string;
30
- }) => void;
31
- patch: (document: Partial<Singular<T>> & {
32
- _id: string;
33
- }) => void;
34
- remove: (document: Partial<Singular<T>> & {
35
- _id: string;
36
- }) => void;
37
- };
38
- export type RealtimeConnectionOne<T> = Observable<T> & {
39
- replace: (document: Omit<Singular<T>, "_id">) => void;
40
- patch: (document: Omit<Partial<Singular<T>>, "_id">) => void;
41
- remove: () => void;
42
- };
43
- type Singular<T> = T extends Array<any> ? T[0] : T;
44
- export {};
@@ -1,18 +0,0 @@
1
- import { Sequence } from "@spica-server/interface/realtime";
2
- import { RealtimeConnection, RealtimeConnectionOne } from "./interface";
3
- export declare class IterableSet<T> implements Iterable<T> {
4
- ids: string[];
5
- dataset: Map<string, T>;
6
- order(sequences: Sequence[]): void;
7
- set(id: string, value: any): void;
8
- delete(id: string, index?: number): void;
9
- [Symbol.iterator](): Iterator<T>;
10
- }
11
- export declare function getWsObs<T>(url: string, sort?: object, relation?: string[] | boolean, bucketId?: string, targetDocumentId?: string, messageCallback?: (res: {
12
- status: number;
13
- message: string;
14
- }) => any): RealtimeConnectionOne<T>;
15
- export declare function getWsObs<T>(url: string, sort?: object, relation?: string[] | boolean, bucketId?: string, targetDocumentId?: null, messageCallback?: (res: {
16
- status: number;
17
- message: string;
18
- }) => any): RealtimeConnection<T[]>;