UNPKG

magicbell

Version:
39 lines (38 loc) 1.7 kB
import { type FromSchema } from 'json-schema-to-ts'; import { type IterablePromise } from '../client/method.js'; import { Resource } from '../client/resource.js'; import { type RequestOptions } from '../client/types.js'; import * as schemas from '../schemas/push-subscriptions.js'; type CreatePushSubscriptionsResponse = FromSchema<typeof schemas.CreatePushSubscriptionsResponseSchema>; type CreatePushSubscriptionsPayload = FromSchema<typeof schemas.CreatePushSubscriptionsPayloadSchema>; type ListPushSubscriptionsResponse = FromSchema<typeof schemas.ListPushSubscriptionsResponseSchema>; export declare class PushSubscriptions extends Resource { path: string; entity: string; /** * Register a device token for push notifications. * * Please keep in mind that mobile push notifications will be delivered to this * device only if the channel is configured and enabled. * * @param data * @param options - override client request options. * @returns **/ create(data: CreatePushSubscriptionsPayload, options?: RequestOptions): Promise<CreatePushSubscriptionsResponse>; /** * Returns the list of device tokens registered for push notifications. * * @param options - override client request options. * @returns **/ list(options?: RequestOptions): IterablePromise<ListPushSubscriptionsResponse>; /** * Deletes the registered device token to remove the mobile push subscription. * * @param deviceToken - Token of the device you want to remove * @param options - override client request options. **/ delete(deviceToken: string, options?: RequestOptions): Promise<void>; } export {};