UNPKG

@hydevs/hypb

Version:

<img src="https://github.com/Hydevs-Corp/Hypb/blob/9308ab4c17196e5c0083c983a528326fd2cba867/.github/assets/banner.png" alt="usehooks-ts banner" align="center" />

25 lines (24 loc) 988 B
import Pocketbase, { RecordModel, RecordService } from 'pocketbase'; import { Collections, Params } from '../types'; type notifyFunction = (message: string, title?: string, additionnalParams?: any) => void; type notificationSystem = { showError: notifyFunction; showInfo: notifyFunction; showNotice: notifyFunction; showSuccess: notifyFunction; }; declare class HypbSingleton { private _pb?; private notificationSystem?; private _userCollection; initPB(url: string, params?: Params): void; initPB(pb: Pocketbase, params?: Params): void; get pb(): Pocketbase; get userCollection(): keyof Collections; set userCollection(collection: keyof Collections); setNotificationSystem(ns: notificationSystem): void; notify(level: keyof notificationSystem, message: string): void; collection<T extends keyof Collections>(collectionName: T): RecordService<Collections[T] & RecordModel>; } export declare const Hypb: HypbSingleton; export {};