import type { EnumNodeLayoutEntry } from "@/exports/typescript/enums/EnumNodeLayoutEntry";
import type { AstNode, AstNodeBase } from "@/types";
import type { UnionAnyKeys } from "@/types/UnionAnyKeys";
export interface AstNodeLayoutBase {
    key: UnionAnyKeys<AstNode>;
    shape: EnumNodeLayoutEntry[];
    optional?: boolean;
}
type OptionalKeys<T> = {
    [K in keyof T]-?: object extends Pick<T, K> ? K : never;
}[keyof T];
type DescriptorFor<T, K extends keyof T> = K extends OptionalKeys<T> ? {
    key: K;
    optional: true;
} : {
    key: K;
    optional?: false;
};
type LayoutFor<T> = {
    [K in keyof T]: AstNodeLayoutBase & DescriptorFor<T, K>;
}[keyof T];
export type AstNodeLayout<NodeType extends AstNodeBase> = LayoutFor<NodeType> & AstNodeLayoutBase;
export {};
//# sourceMappingURL=AstNodeLayout.d.ts.map