콘텐츠로 이동

ExpoPushGatewayOptions — @gj-kit/nest-notifications

@gj-kit/nest-notifications/expo에서 공개하는 interface입니다. package version 0.1.1의 release declaration을 그대로 표시합니다.

import { ExpoPushGatewayOptions } from '@gj-kit/nest-notifications/expo';
interface ExpoPushGatewayOptions {
/**
* Sends one chunk. Declared with method syntax on purpose: method parameters
* are compared bivariantly, so an `expo-server-sdk` instance's
* `sendPushNotificationsAsync(messages: ExpoPushMessage[])` is assignable as is.
* As an arrow-function property it would not be - under `strictFunctionTypes`
* the parameter is contravariant and `readonly ExpoPushMessage[]` is not
* assignable to `ExpoPushMessage[]` (design 2.2). A 15-line `fetch` call fits
* the same shape; the library never imports either.
*
* **Assignability is not binding.** The gateway detaches this callback from the
* options object and calls it with no receiver, so a class method that reads
* `this` MUST be bound:
*
* ```ts
* send: expo.sendPushNotificationsAsync.bind(expo)
* // or: send: (messages) => expo.sendPushNotificationsAsync([...messages])
* ```
*
* `expo-server-sdk`'s method is exactly such a method (it dereferences
* `this.limitConcurrentRequests`), so `send: expo.sendPushNotificationsAsync`
* type-checks and then throws on the first call - which this gateway absorbs
* into `accepted: false`. Every push then fails silently, every delivery burns
* its attempts, and nothing in the log names the cause.
*/
send(messages: readonly ExpoPushMessage[]): Promise<readonly ExpoPushTicket[]>;
/**
* Title used when a notification has none. Required and nullable rather than
* defaulted: the source hard-coded its product name here, and that is a value
* this library cannot hold.
*/
readonly defaultTitle: string | null;
/** Defaults to `'default'`, matching the source. */
readonly sound?: 'default' | null | undefined;
readonly channelId?: string | undefined;
/** Continue remaining chunks after one fails. Default true (matches source). */
readonly continueAfterChunkFailure?: boolean | undefined;
}

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/nest-notifications
  • 버전: 0.1.1
  • 공개 entry: ./expo
  • 소스: GitHub