UNPKG

tav-ui

Version:
1 lines 1 kB
{"version":3,"file":"usePageContext2.mjs","sources":["../../../../../../packages/hooks/component/usePageContext.ts"],"sourcesContent":["/* eslint-disable symbol-description */\nimport { createContext, useContext } from '../core/useContext'\nimport type { ComputedRef, InjectionKey, Ref } from 'vue'\n\nexport interface PageContextProps {\n contentHeight: ComputedRef<number>\n pageHeight: Ref<number>\n setPageHeight: (height: number) => Promise<void>\n}\n\nconst key: InjectionKey<PageContextProps> = Symbol()\n\nexport function createPageContext(context: PageContextProps) {\n return createContext<PageContextProps>(context, key, { native: true })\n}\n\nexport function usePageContext() {\n return useContext<PageContextProps>(key)\n}\n"],"names":[],"mappings":";;AACA,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;AACd,SAAS,iBAAiB,CAAC,OAAO,EAAE;AAC3C,EAAE,OAAO,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC;AACM,SAAS,cAAc,GAAG;AACjC,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;AACzB;;;;"}