// See https://kit.svelte.dev/docs/types#app import type { SessionMetadata } from '$lib/components/ui/player/util' import type { Search } from '$lib/modules/anilist/queries' import type { VariablesOf } from 'gql.tada' import type { CompositionEventHandler } from 'svelte/elements' // for information about these interfaces export interface AuthResponse { access_token: string expires_in: string // seconds token_type: 'Bearer' } export interface Track { selected: boolean enabled: boolean id: string kind: string label: string language: string } export interface TorrentFile { name: string hash: string type: string size: number path: string url: string id: number } export interface Attachment { filename: string mimetype: string id: number url: string } export interface TorrentInfo { peers: number progress: number down: number up: number name: string hash: string seeders: number leechers: number size: number downloaded: number eta: number } export interface TorrentSettings { torrentPersist: boolean torrentDHT: boolean torrentStreamedDownload: boolean torrentSpeed: number maxConns: number torrentPort: number dhtPort: number torrentPeX: boolean } export interface Native { authAL: (url: string) => Promise restart: () => Promise openURL: (url: string) => Promise share: Navigator['share'] minimise: () => Promise maximise: () => Promise focus: () => Promise close: () => Promise selectPlayer: () => Promise selectDownload: () => Promise setAngle: (angle: string) => Promise getLogs: () => Promise getDeviceInfo: () => Promise openUIDevtools: () => Promise openTorrentDevtools: () => Promise checkUpdate: () => Promise toggleDiscordDetails: (enabled: boolean) => Promise setMediaSession: (metadata: SessionMetadata, mediaId: number) => Promise setPositionState: (state?: MediaPositionState) => Promise setPlayBackState: (paused: 'none' | 'paused' | 'playing') => Promise setActionHandler: (action: MediaSessionAction | 'enterpictureinpicture', handler: MediaSessionActionHandler | null) => void checkAvailableSpace: (_?: unknown) => Promise checkIncomingConnections: (port: number) => Promise updatePeerCounts: (hashes: string[]) => Promise> playTorrent: (id: string) => Promise attachments: (hash: string, id: number) => Promise tracks: (hash: string, id: number) => Promise> subtitles: (hash: string, id: number, cb: (subtitle: { text: string, time: number, duration: number }, trackNumber: number) => void) => Promise chapters: (hash: string, id: number) => Promise> torrentStats: (hash: string) => Promise torrents: () => Promise setDOH: (dns: string) => Promise cachedTorrents: () => Promise downloadProgress: (percent: number) => Promise updateSettings: (settings: TorrentSettings) => Promise updateProgress: (cb: (progress: number) => void) => Promise spawnPlayer: (url: string) => Promise setHideToTray: (enabled: boolean) => Promise transparency: (enabled: boolean) => Promise setZoom: (scale: number) => Promise isApp: boolean version: () => Promise navigate: (cb: (data: { target: string, value: string | undefined }) => void) => Promise } declare global { namespace App { // interface Error {} // interface Locals {} // interface PageData {} interface PageState { search?: VariablesOf } // interface Platform {} } interface HTMLMediaElement { videoTracks?: Track[] audioTracks?: Track[] } interface ScreenOrientation { lock: (orientation: 'any' | 'natural' | 'landscape' | 'portrait' | 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary') => Promise } interface Navigator { userAgentData: { getHighEntropyValues: (keys: string[]) => Promise> } } declare namespace svelteHTML { interface HTMLAttributes { 'on:navigate'?: CompositionEventHandler } } // declare module '*.svelte' { // export default SvelteComponentTyped // } } export {}