Initial commit: code as received (Create/Anything export)
Insole-production time tracker exported from the Create/Anything AI platform. Baseline snapshot before any reverse-engineering or cleanup. - apps/mobile: Expo Router app (iOS/Android/web), the only workspace - publisher/: standalone OpenNext/AWS deploy tooling for the web side - Backend (/api/tasks, /api/logs + DB) lives remotely, not in this repo
This commit is contained in:
49
apps/mobile/polyfills/web/clipboard.web.ts
Normal file
49
apps/mobile/polyfills/web/clipboard.web.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
export async function getStringAsync(): Promise<string> {
|
||||
try {
|
||||
return await navigator.clipboard.readText();
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
export async function setStringAsync(text: string): Promise<boolean> {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function hasStringAsync(): Promise<boolean> {
|
||||
try {
|
||||
const text = await navigator.clipboard.readText();
|
||||
return text.length > 0;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getImageAsync() {
|
||||
return null;
|
||||
}
|
||||
|
||||
export async function setImageAsync() {}
|
||||
|
||||
export async function hasImageAsync(): Promise<boolean> {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function addClipboardListener(
|
||||
_listener: (event: { contentTypes: string[] }) => void
|
||||
) {
|
||||
return { remove: () => {} };
|
||||
}
|
||||
|
||||
export function removeClipboardListener(subscription: { remove: () => void }) {
|
||||
subscription.remove();
|
||||
}
|
||||
|
||||
export function isPlatformSupported(): boolean {
|
||||
return typeof navigator !== 'undefined' && !!navigator.clipboard;
|
||||
}
|
||||
Reference in New Issue
Block a user