17 lines
284 B
TypeScript
17 lines
284 B
TypeScript
export interface BootstrapState {
|
|
username?: string
|
|
userId?: string
|
|
isAdmin?: boolean
|
|
error?: string
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
__BOOTSTRAP__?: BootstrapState
|
|
}
|
|
}
|
|
|
|
export function getBootstrapState(): BootstrapState {
|
|
return window.__BOOTSTRAP__ ?? {}
|
|
}
|