1 line
2.6 KiB
Plaintext
1 line
2.6 KiB
Plaintext
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,gBAAgB,GAAG,yBAAyB,CAAC;AAEnD,cAAc;AACd;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,gBAAgB;IACzD,SAAS,CAAC,GAAG,EAAE;QACb,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,GAAG,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,cAAc;AACd;;;;;;;GAOG;AAEH,MAAM,UAAU,iBAAiB,CAAC,MAAc,gBAAgB;IAC9D,IAAI,aAAa,CAAC,QAAQ;QAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,cAAc;AACd;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,gBAAgB;IAChE,IAAI,aAAa,CAAC,UAAU;QAAE,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import { useEffect } from 'react';\n\nimport ExpoKeepAwake from './ExpoKeepAwake';\n\nconst ExpoKeepAwakeTag = 'ExpoKeepAwakeDefaultTag';\n\n// @needsAudit\n/**\n * A React hook to keep the screen awake for as long as the owner component is mounted.\n * The optionally provided `tag` argument is used when activating and deactivating the keep-awake\n * feature. If unspecified, the default `tag` is used. See the documentation for `activateKeepAwake`\n * below to learn more about the `tag` argument.\n * @param tag *Optional*\n */\nexport function useKeepAwake(tag: string = ExpoKeepAwakeTag): void {\n useEffect(() => {\n activateKeepAwake(tag);\n return () => deactivateKeepAwake(tag);\n }, [tag]);\n}\n\n// @needsAudit\n/**\n * Prevents the screen from sleeping until `deactivateKeepAwake` is called with the same `tag` value.\n *\n * If the `tag` argument is specified, the screen will not sleep until you call `deactivateKeepAwake`\n * with the same `tag` argument. When using multiple `tags` for activation you'll have to deactivate\n * each one in order to re-enable screen sleep. If tag is unspecified, the default `tag` is used.\n * @param tag *Optional* - Tag to lock screen sleep prevention. If not provided, the default tag is used.\n */\n\nexport function activateKeepAwake(tag: string = ExpoKeepAwakeTag): void {\n if (ExpoKeepAwake.activate) ExpoKeepAwake.activate(tag);\n}\n\n// @needsAudit\n/**\n * Releases the lock on screen-sleep prevention associated with the given `tag` value. If `tag`\n * is unspecified, it defaults to the same default tag that `activateKeepAwake` uses.\n * @param tag *Optional* - Tag to release the lock on screen sleep prevention. If not provided,\n * the default tag is used.\n */\nexport function deactivateKeepAwake(tag: string = ExpoKeepAwakeTag): void {\n if (ExpoKeepAwake.deactivate) ExpoKeepAwake.deactivate(tag);\n}\n"]} |