import { MissingControllerProps } from '../../utils/errors.js';
import { buildContext } from './headless-context.js';
export * from './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 });
        },
    };
}
