15 lines
513 B
TypeScript
15 lines
513 B
TypeScript
|
|
import type { InjectionKey, Ref } from 'vue'
|
||
|
|
|
||
|
|
/** What the fullscreen frame tells the page drawn on it: where the menu bar ends. */
|
||
|
|
export interface Stage {
|
||
|
|
/** px from the top of the window to the bottom of the menu bar. */
|
||
|
|
menuBottom: Ref<number>
|
||
|
|
}
|
||
|
|
|
||
|
|
const STAGE: InjectionKey<Stage> = Symbol('stage')
|
||
|
|
|
||
|
|
export const provideStage = (stage: Stage) => provide(STAGE, stage)
|
||
|
|
|
||
|
|
/** The fullscreen frame around the page, or null where a page stands without one. */
|
||
|
|
export const useStage = () => inject(STAGE, null)
|