import { buildContext, } from '../../../../controllers/context/headless-context.js';
import { MissingControllerProps } from '../../../common/errors.js';
export * from '../../../../controllers/context/headless-context.js';
/**
 * Defines a `Context` controller instance.
 * @group Definers
 *
 * @returns The `Context` controller definition.
 * */
export function defineContext() {
    return {
        buildWithProps: (engine, props) => {
            if (props === undefined) {
                throw new MissingControllerProps('Context');
            }
            return buildContext(engine, { initialState: props.initialState });
        },
    };
}
