UNPKG

@allthings/sdk

Version:
29 lines (28 loc) 1.42 kB
import { IAllthingsRestClient } from '../types'; export type BucketResult = Promise<IBucket>; export interface IBucket { readonly channels: readonly string[]; readonly files: readonly string[]; readonly id: string; readonly name: string; } export type MethodBucketGet = (bucketId: string) => BucketResult; export declare function bucketGet(client: IAllthingsRestClient, bucketId: string): BucketResult; export type MethodBucketCreate = (data: { readonly channels: readonly string[]; readonly name: string; }) => BucketResult; export declare function bucketCreate(client: IAllthingsRestClient, data: { readonly channels: readonly string[]; readonly name: string; }): BucketResult; export type MethodBucketAddFile = (bucketId: string, fileId: string) => Promise<boolean>; export declare function bucketAddFile(client: IAllthingsRestClient, bucketId: string, fileId: string): Promise<boolean>; export type MethodBucketRemoveFile = (bucketId: string, fileId: string) => Promise<boolean>; export declare function bucketRemoveFile(client: IAllthingsRestClient, bucketId: string, fileId: string): Promise<boolean>; export type MethodBucketRemoveFilesInPath = (bucketId: string, data: { readonly path: string; }) => Promise<boolean>; export declare function bucketRemoveFilesInPath(client: IAllthingsRestClient, bucketId: string, data: { readonly path: string; }): Promise<boolean>;