magically-sdk
Version:
Official SDK for Magically - Build mobile apps with AI
39 lines (38 loc) • 1.28 kB
TypeScript
/**
* Platform detection and abstraction layer
* Provides environment-specific implementations
*/
interface StorageInterface {
getItem: (key: string) => Promise<string | null>;
setItem: (key: string, value: string) => Promise<void>;
removeItem: (key: string) => Promise<void>;
}
interface WebBrowserInterface {
openBrowserAsync: (url: string) => Promise<any>;
openAuthSessionAsync?: (url: string, redirectUri: string) => Promise<any>;
maybeCompleteAuthSession: () => {
type: string;
};
}
interface PlatformInterface {
OS: string;
select: (obj: any) => any;
}
interface LinkingInterface {
createURL: (path?: string, options?: {
scheme?: string;
queryParams?: Record<string, string>;
isTripleSlashed?: boolean;
}) => string;
}
interface SecureStoreInterface {
getItemAsync: (key: string) => Promise<string | null>;
setItemAsync: (key: string, value: string) => Promise<void>;
deleteItemAsync: (key: string) => Promise<void>;
}
export declare let AsyncStorage: StorageInterface;
export declare let WebBrowser: WebBrowserInterface;
export declare let Platform: PlatformInterface;
export declare let SecureStore: SecureStoreInterface;
export declare let Linking: LinkingInterface;
export {};