import { Task, Operation } from '@effection/core'; export * from './error'; export { formatError } from './format-error-node'; /** * Runs the given operation in a task and returns that task. `main` functions * as an entry point to programs written in Effection. That means that your * program should only call `main` once, and everything the program does is * handled from within `main`. Unlike `run`, `main` automatically prints errors * that occurred to the console. * * Using {@link MainError}, the `main` operation can be aborted without causing * a stack trace to be printed to the console. * * The behaviour of `main` is slightly different depending on the environment it * is running in. * * ### Node * * When running within node, any error which reaches `main` causes the entire * process to exit with an exit code of `1`. * * Additionally, handlers for `SIGINT` and `SIGTERM` are attached to the * process, so that sending an exit signal to the process causes the main task * to become halted. This means that hitting CTRL-C on an Effection program * using `main` will cause an orderly shutdown and run all finally blocks and * ensure operations. * * ### Browser * * When running in a browser, The `main` operation gets shut down on the * `unload` event. */ export declare function main(operation: Operation): Task; //# sourceMappingURL=node.d.ts.map