@warpkit/types
v0.0.6
Published
Shared TypeScript type definitions for WarpKit
Readme
@warpkit/types
Shared TypeScript types for WarpKit packages.
Installation
bun add @warpkit/typesTypes
AuthAdapter
Interface for authentication adapters.
import type { AuthAdapter, AuthInitResult } from '@warpkit/types';
const adapter: AuthAdapter<AppState, StateData> = {
initialize: async () => {
// Return initial auth state
return { state: 'unauthenticated' };
},
onAuthStateChanged: (callback) => {
// Subscribe to auth changes
return unsubscribe;
},
signOut: async () => {
// Sign out user
}
};AuthInitResult
Result from auth adapter initialization.
interface AuthInitResult<TAppState, TStateData> {
state: TAppState;
stateData?: TStateData;
}Usage
These types are re-exported from @warpkit/core for convenience:
import type { AuthAdapter } from '@warpkit/core';