Newer
Older
mobile.raikyakun.app / node / src / types / globals.d.ts
nutrition 14 hours ago 686 bytes 利便性向上
export {}

declare global {
	interface BeforeInstallPromptEvent extends Event {
		prompt(): Promise<void>
		userChoice: Promise<{ outcome: 'accepted' | 'dismissed' }>
	}

	interface RelatedApplication {
		platform: string
		url?: string
		id?: string
	}

	interface Navigator {
		getInstalledRelatedApps?(): Promise<RelatedApplication[]>
	}

	interface Window {
		webkit?: {
			messageHandlers?: Record<
				string,
				{ postMessage: (payload: any) => void }
			>
		}
		__nativeCallback?: (res: NotificationResult) => void
	}

	interface NotificationResult {
		status: 'authorized' | 'notDetermined' | 'denied' | 'requested' | 'unknown'
		token: string | null
		id: string | null
	}
}