{"version":3,"file":"lifecycle.mjs","sourceRoot":"","sources":["../../../src/types/handlers/lifecycle.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A lifecycle event handler. This is called whenever a lifecycle event occurs,\n * such as the Snap being installed or updated.\n *\n * Note that using this handler requires the `endowment:lifecycle-hooks`\n * permission.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin that triggered the lifecycle event hook.\n */\nexport type LifecycleEventHandler = (args: {\n  origin: string;\n}) => Promise<unknown>;\n\n/**\n * The `onInstall` handler. This is called after the Snap is installed.\n *\n * Note that using this handler requires the `endowment:lifecycle-hooks`\n * permission.\n *\n * This type is an alias for {@link LifecycleEventHandler}.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin that triggered the lifecycle event hook.\n */\nexport type OnInstallHandler = LifecycleEventHandler;\n\n/**\n * The `onUpdate` handler. This is called after the Snap is updated.\n *\n * Note that using this handler requires the `endowment:lifecycle-hooks`\n * permission.\n *\n * This type is an alias for {@link LifecycleEventHandler}.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin that triggered the lifecycle event hook.\n */\nexport type OnUpdateHandler = LifecycleEventHandler;\n\n/**\n * The `onStart` handler. This is called when the client is started.\n *\n * Note that using this handler requires the `endowment:lifecycle-hooks`\n * permission.\n *\n * This type is an alias for {@link LifecycleEventHandler}.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin that triggered the lifecycle event hook.\n */\nexport type OnStartHandler = LifecycleEventHandler;\n\n/**\n * The `onActive` handler. This is called when the client becomes active.\n *\n * Note that using this handler requires the `endowment:lifecycle-hooks`\n * permission.\n *\n * This type is an alias for {@link LifecycleEventHandler}.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin that triggered the lifecycle event hook.\n */\nexport type OnActiveHandler = LifecycleEventHandler;\n\n/**\n * The `onInactive` handler. This is called when the client becomes inactive.\n *\n * Note that using this handler requires the `endowment:lifecycle-hooks`\n * permission.\n *\n * This type is an alias for {@link LifecycleEventHandler}.\n *\n * @param args - The request arguments.\n * @param args.origin - The origin that triggered the lifecycle event hook.\n */\nexport type OnInactiveHandler = LifecycleEventHandler;\n"]}