Files
cinny/src/ext.d.ts
T
litruv 87c9f59826
Trigger cinny-mobile / dispatch (push) Successful in 2s
Use public Discord collectibles catalog.
Remove local token setup in favor of the cached published catalog and document the collectible profile experience in the latest update notes.
2026-08-24 19:29:48 +10:00

143 lines
3.3 KiB
TypeScript

/// <reference types="vite/client" />
declare module 'browser-encrypt-attachment' {
export interface EncryptedAttachmentInfo {
v: string;
key: {
alg: string;
key_ops: string[];
kty: string;
k: string;
ext: boolean;
};
iv: string;
hashes: {
[alg: string]: string;
};
}
export interface EncryptedAttachment {
data: ArrayBuffer;
info: EncryptedAttachmentInfo;
}
export function encryptAttachment(dataBuffer: ArrayBuffer): Promise<EncryptedAttachment>;
export function decryptAttachment(
dataBuffer: ArrayBuffer,
info: EncryptedAttachmentInfo
): Promise<ArrayBuffer>;
}
declare module '*.svg' {
const content: string;
export default content;
}
interface PluginAPI {
getPath: () => Promise<{ success: boolean; data?: string; error?: string }>;
download: (
pluginId: string,
downloadUrl: string,
name: string
) => Promise<{ success: boolean; data?: { path: string }; error?: string }>;
list: () => Promise<{
success: boolean;
data?: Array<{ id: string; name: string; installedDate: string; path: string }>;
error?: string;
}>;
uninstall: (pluginId: string) => Promise<{ success: boolean; error?: string }>;
readPluginCode: (pluginId: string) => Promise<{ success: boolean; data?: string; error?: string }>;
}
interface ElectronAPI {
platform?: string;
arch?: string;
clipboard?: {
writeText: (text: string) => void;
};
media?: {
saveFile: (payload: {
filename: string;
mimeType?: string;
data: Uint8Array;
}) => Promise<{
success?: boolean;
canceled?: boolean;
path?: string;
error?: string;
}>;
};
plugins?: PluginAPI;
protocol?: {
getStatus: () => Promise<{
success: boolean;
data?: {
scheme: string;
platform: string;
isDefault: boolean;
before: boolean;
registerCall: boolean;
error: string | null;
windows: null | {
userChoiceProgId: string | null;
userChoiceCommand: string | null;
hkcuCommand: string | null;
hklmCommand: string | null;
};
};
error?: string;
}>;
repair: () => Promise<{
success: boolean;
data?: {
scheme: string;
platform: string;
isDefault: boolean;
before: boolean;
registerCall: boolean;
error: string | null;
windows: null | {
userChoiceProgId: string | null;
userChoiceCommand: string | null;
hkcuCommand: string | null;
hklmCommand: string | null;
};
};
error?: string;
}>;
};
updater?: {
onUpdateDownloaded: (callback: (info: {
version: string;
releaseNotes?: unknown;
}) => void) => void;
};
discordCollectibles?: {
fetchCatalog: (force?: boolean) => Promise<{
success: boolean;
data?: { items: unknown[]; fetchedAt: string };
error?: string;
}>;
downloadAssets: (assets: Array<{ role: string; url: string; filename: string; mimeType: string }>) => Promise<{
success: boolean;
data?: Array<{
role: string;
url: string;
filename: string;
mimeType: string;
data: Uint8Array;
}>;
error?: string;
}>;
};
}
declare global {
interface Window {
electron?: ElectronAPI;
}
}
export {};