import { ApplicationUserDto, BaseBlock, BranchDto, CommitDto, DatasourceEnvironments, DataTreeGroup, DataTreeUser, DegradedMode, Difference, ExportedApiV3Dto, IApiV3Dto, Plugin, RepositoryDto, SupersetIntegrationDto } from '..';
import { ApplicationSignatureTreeSigned, Signature } from '../../signing/index.js';
import { ResourceMetadata } from '../metadata/index.js';
import { Dimension, EntityWithBindings6, IPageV2Dto, MultiStepDef, Padding, PageDSL, PageSummary } from '../page/index.js';
import { EntityProfileSettings } from '../profile/index.js';
import { IResourceMetadata } from '../resource/index.js';
export interface Application {
    id: string;
    environment: DatasourceEnvironments;
    name: string;
    icon?: string;
    color: string;
    organizationId: string;
    new: boolean;
    appIsExample: boolean;
    isPublic: boolean;
    userPermissions: string[];
    deletedAt: Date | undefined;
    settings: ApplicationSettings;
    configuration?: ApplicationConfiguration;
}
export type GetEditorsForAppIdResponse = ApplicationUserDto[];
interface PropertiesPanelDisplay {
    controlType: 'text' | 'js-expr' | 'switch';
    label: string;
    defaultValue?: string | number | boolean;
    placeholder?: string;
    exampleData?: string;
    expectedType?: string;
}
/** @pattern ^[a-zA-Z_][a-zA-Z0-9_]*$ */
type Identifier = string;
export interface CustomComponentProperty {
    path: Identifier;
    dataType: 'string' | 'number' | 'boolean' | 'any';
    propertiesPanelDisplay?: PropertiesPanelDisplay;
    description?: string;
    isExternallySettable?: boolean;
    isExternallyReadable?: boolean;
}
export interface PreviousCustomComponentConfigs {
    '0.0.20': {
        id: string;
        name: string;
        displayName: string;
        componentPath: string;
        statefulProperties: Array<{
            path: string;
            label: string;
            inputType: 'text' | 'number' | 'boolean' | 'js';
            placeholder?: string;
        }>;
        eventHandlers: Array<{
            label: string;
            path: string;
        }>;
    };
    '0.0.21': {
        id: string;
        name: string;
        displayName: string;
        componentPath: string;
        properties: Array<{
            path: string;
            dataType: 'string' | 'number' | 'boolean' | 'any';
            propertiesPanelDisplay?: {
                controlType: 'text' | 'js-expr' | 'switch';
                label: string;
                defaultValue?: string;
                placeholder?: string;
                exampleData?: string;
            };
            description?: string;
        }>;
        events: Array<{
            label: string;
            path: string;
        }>;
    };
}
export interface CustomComponentConfig {
    id: string;
    name: string;
    displayName: string;
    componentPath: string;
    properties: CustomComponentProperty[];
    events: Array<{
        label: string;
        path: Identifier;
    }>;
    gridDimensions?: {
        initialColumns: number;
        initialRows: number;
    };
}
export declare enum ComponentEvent {
    CREATE = "create",
    INIT = "init",
    LOGIN = "login",
    MIGRATE = "migrate",
    PULL = "pull",
    PUSH = "push",
    REGISTER = "register",
    UPLOAD = "upload",
    DEPLOY = "deploy"
}
export type RegisteredComponents = Record<string, CustomComponentConfig>;
type BaseRoute = {
    id: string;
    path: string;
    testParams?: Record<string, string>;
    onRouteLoad?: MultiStepDef;
} & EntityWithBindings6;
export type PageRoute = BaseRoute & {
    pageId: string;
};
type PageComponentRoute = PageRoute & {
    widgetId: string;
};
type RedirectRoute = BaseRoute;
export type RouteDef = PageRoute | PageComponentRoute | RedirectRoute;
export declare const DEFAULT_ROUTE_ID = "ahjjxoy521";
export declare function getDefaultRoute(pageId: string): RouteDef;
export interface ApplicationConfiguration {
    version?: 1;
    routes?: Record<string, RouteDef>;
    dsl?: {
        version: 8;
        stateVars?: PageDSL['stateVars'];
        timers?: PageDSL['timers'];
        events?: PageDSL['events'];
        apis?: PageDSL['apis'];
    };
}
export interface ApplicationConfigurationUpdate extends ApplicationConfiguration {
    routes: Record<string, RouteDef>;
}
export declare enum ThemeMode {
    LIGHT = "LIGHT",
    DARK = "DARK",
    AUTO = "AUTO"
}
export type Border = {
    color?: string;
    width?: Dimension<'px'>;
    style?: 'solid';
};
export type PerSideBorder = {
    left: Border;
    right: Border;
    top: Border;
    bottom: Border;
};
export type PerCornerBorderRadius = {
    topLeft: Dimension<'px'>;
    topRight: Dimension<'px'>;
    bottomLeft: Dimension<'px'>;
    bottomRight: Dimension<'px'>;
};
export type UserDefinedPalette = {
    primaryColor: string;
    appBackgroundColor: string;
};
export interface ColorBlock {
    default: string;
    disabled?: string;
    hover?: string;
    error?: string;
    active?: string;
    activeHover?: string;
}
interface TextColorBlock {
    textColor: ColorBlock;
}
interface BackgroundColorBlock {
    backgroundColor: ColorBlock;
}
interface BorderColorBlock {
    borderColor: ColorBlock;
}
interface BoxShadowBlock {
    boxShadow: ColorBlock;
}
export interface IconColorBlock {
    iconColor: ColorBlock;
}
interface SizeBlock {
    height: Dimension;
    width: Dimension;
}
export interface ColoredDimensionStyle {
    size: Dimension;
    color?: string;
}
export interface BorderStyleBlock extends BorderColorBlock, BoxShadowBlock {
    borderWidth: Dimension;
    borderStyle: string;
    borderRadius: Dimension;
}
export interface StyleBlockWithSize extends StyleBlock, SizeBlock {
}
export interface TextStyleBlock extends TextColorBlock {
    fontFamily: string;
    fontSize: string;
    fontWeight: number;
    lineHeight: number | string;
    textDecoration?: string;
    fontStyle?: 'normal' | 'italic' | 'inherit';
    letterSpacing?: string;
    textTransform?: 'uppercase' | 'lowercase' | 'capitalize' | 'none' | 'inherit';
}
export type CustomTypographies = Record<string, {
    styles: TextStyleBlock;
    name: string;
    key: string;
}>;
export interface StyleBlock extends TextStyleBlock, BorderStyleBlock, BackgroundColorBlock {
    padding: Padding;
}
export declare const CUSTOM_THEME_TYPOGRAPHY_KEY = "custom";
export type Typographies = {
    heading1: TextStyleBlock;
    heading2: TextStyleBlock;
    heading3: TextStyleBlock;
    heading4: TextStyleBlock;
    heading5: TextStyleBlock;
    heading6: TextStyleBlock;
    body1: TextStyleBlock;
    body2: TextStyleBlock;
    body3: TextStyleBlock;
    label: TextStyleBlock;
    inputLabel: TextStyleBlock;
    inputPlaceholder: TextStyleBlock;
    inputText: TextStyleBlock;
    buttonLabel: TextStyleBlock;
    link: TextStyleBlock;
    code: TextStyleBlock;
    [CUSTOM_THEME_TYPOGRAPHY_KEY]?: CustomTypographies;
};
export type NonCustomTypography = Exclude<keyof Typographies, typeof CUSTOM_THEME_TYPOGRAPHY_KEY>;
export type FontFamily = {
    name: string;
    key: string;
    url?: string;
    type: 'google' | 'custom';
    weights?: Array<number>;
};
export type UserDefinedTheme = {
    primaryColor: string;
    mode: ThemeMode;
    borderRadius: Dimension<'px'>;
    typeFace: string;
    padding?: Padding;
    palette?: {
        dark?: UserDefinedPalette;
        light?: UserDefinedPalette;
    };
    typographies?: Typographies;
    availableFonts?: Record<string, FontFamily>;
    version?: number;
};
export type ApplicationSettings = EntityProfileSettings & VersionedApplicationSettings;
export type NonVersionedApplicationSettings = Difference<ApplicationSettings, ExportedApplicationSettings>;
export type VersionedApplicationSettings = {
    componentBaseUrl?: string;
    registeredComponents?: RegisteredComponents;
    files?: string[];
    sourceFiles?: string[];
    bundledFiles?: string[];
    cliVersion?: string;
    componentsLastUploaded?: string;
    theme?: UserDefinedTheme;
};
export declare function toExportedApplicationSettings(applicationSettings: ApplicationSettings): ExportedApplicationSettings;
export declare function toNonVersionedApplicationSettings(applicationSettings?: ApplicationSettings): NonVersionedApplicationSettings | undefined;
export type ApplicationSettingsResponse = ApplicationSettings & {
    prefix?: string;
};
export interface FullApplicationV2Dto {
    application: IApplicationV2Dto;
    metadata?: ResourceMetadata;
    plugins?: Plugin[];
    integrations?: SupersetIntegrationDto[];
    page?: IPageV2Dto | null;
    editors?: ApplicationUserDto[];
    global?: Partial<ApplicationV2GlobalDto>;
    apis?: IApiV3Dto[];
    versions?: {
        current: CommitDto;
    };
}
export type ExportedApplication = Omit<FullApplicationV2Dto['application'], 'updated' | 'created' | 'creator' | 'deletedAt' | 'deployedAt' | 'deployedCommitId' | 'folderId' | 'isDeployed' | 'isPublic' | 'isEditable' | 'userPermissions' | 'settings' | 'pageSummaryList'> & {
    settings?: ExportedApplicationSettings;
    pages: {
        id: string;
        isDefault: boolean;
    }[];
};
export type ExportedMultiPageApplication = Pick<FullApplicationV2Dto['application'], 'id' | 'name' | 'organizationId' | 'configuration' | 'devEnvEnabled' | 'templateName'> & {
    settings?: ExportedApplicationSettings;
};
export type ExportedPage = Omit<IPageV2Dto, 'updated'>;
export type ExportedPageWithApis = Omit<IPageV2Dto, 'updated' | 'apis'> & {
    apis?: ExportedApiV3Dto[];
};
type ExportedApplicationSettings = Omit<ApplicationSettings, 'profiles'>;
export type ExportedMultiPageApplicationDto = Omit<FullApplicationV2Dto, 'application' | 'page' | 'apis'> & {
    application: ExportedMultiPageApplication;
    apis?: ExportedApiV3Dto[];
    deployedCommitId?: string | null;
    pages?: ExportedPageWithApis[];
};
export declare function isFullApplicationV2Dto(value: unknown): value is FullApplicationV2Dto;
export declare function isExportedApplicationDto(value: unknown): value is ExportedMultiPageApplicationDto;
export interface IApplicationV2Dto {
    id: string;
    name: string;
    organizationId: string;
    pageSummaryList?: PageSummary[];
    isPublic: boolean;
    isDeployed: boolean;
    deployedCommitId?: string | null;
    deployedGitSha?: string | null;
    isEditable: boolean;
    canDelete?: boolean;
    userPermissions: string[];
    deletedAt: Date | null;
    updated: Date;
    created: Date;
    deployedAt?: Date | null;
    folderId: string | null;
    creator?: {
        id: string;
        name: string;
        email: string;
    };
    settings?: ApplicationSettings;
    signature?: ApplicationSignatureTreeSigned | null;
    configuration?: ApplicationConfiguration;
    repoConnection?: {
        created: Date;
        repository: RepositoryDto;
    };
    currentBranch?: BranchDto;
    devEnvEnabled?: boolean;
    /** The name of the template used to create this application (e.g., 'shadcn-demo-app', 'blank-app'). Null for legacy apps. */
    templateName?: string | null;
    degradedMode?: DegradedMode;
    removedProfiles?: Record<string, Array<{
        id: string;
        key: string;
        displayName: string;
    }>>;
}
export interface IHomepageApplicationV2Dto extends IResourceMetadata {
    deployedAt?: Date | null;
    creator?: {
        id: string;
        name: string;
        email: string;
    };
}
export interface ApplicationV2GlobalDto {
    groups: DataTreeGroup[];
    user: DataTreeUser;
    versions: {
        current: CommitDto;
    };
}
export type PostApplicationCreateRequestBody = {
    name: string;
    organizationId: string;
    isPublic?: boolean;
    folderId?: string;
    settings?: Partial<ApplicationSettings>;
    configuration?: ApplicationConfiguration;
    signature?: ApplicationSignatureTreeSigned;
    ipCountry?: string;
    /** only used for DSL applications */
    initialPageDSL?: PageDSL;
    /** only used for React applications */
    createUsingReact?: boolean;
    /** which template to use when creating a React/code-mode application (e.g. 'shadcn-demo-app', 'blank-app') */
    templateName?: string;
    /** When provided, server generates an AI app name from this prompt */
    initialPrompt?: string;
};
export interface ApplicationPageClonePayload {
    applicationId: string;
    pageId: string;
    pageName: string;
    routePath: string;
    branch?: string;
    lastSuccessfulWrite: number;
    signingRequired: boolean;
}
export interface CreateApplicationPagePayload {
    pageId?: string;
    dsl?: PageDSL;
    routePath?: string;
    testParams?: Record<string, string>;
    signature?: ApplicationSignatureTreeSigned;
    lastSuccessfulWrite: number;
}
export type CreateApplicationPageSocketPayload = CreateApplicationPagePayload & {
    applicationId: string;
    signingRequired: boolean;
    branchName?: string;
    superblocksSupportUpdateEnabled?: boolean;
};
export type ModifyEntitiesPayload = {
    applicationId: string;
    appConfiguration: ApplicationConfigurationUpdate;
    pages: ModifyEntitiesPayloadPage[];
    apis: ModifyEntitiesPayloadApi[];
    renames?: ModifyEntityiesPayloadRename[];
    branch?: string;
    lastSuccessfulWrite: number;
    signingRequired: boolean;
};
type ModifyEntitiesPayloadPage = {
    pageId: string;
    dsl: PageDSL;
};
export type ModifyEntitiesPayloadApi = {
    apiId: string;
    pageId?: string;
    dsl: {
        metadata?: Record<string, unknown>;
        blocks?: BaseBlock[];
        trigger: Record<string, unknown>;
        signature?: Signature;
    };
};
export type ModifyEntityiesPayloadRename = {
    newName: string;
    oldName: string;
    entityId: string;
};
export type ModifyEntitiesResponse = {
    updatedTime: number;
    updatedAPIs?: string[];
    signature?: ApplicationSignatureTreeSigned;
};
export declare enum ApplicationScope {
    APP = "APP",
    PAGE = "PAGE",
    GLOBAL = "GLOBAL"
}
export type ApplicationHashChangeSource = 'ai:reject' | 'ai:accept' | 'ai:generate:pre' | 'ai:generate:interim' | 'ai:generate:post' | 'rootUpdate' | 'multiRootUpdate' | 'rootReset' | 'fileChanged' | 'apiUpdate' | 'apiManualUpdate' | 'apiDelete' | 'apiManualDelete' | 'requestedFilesSync' | 'cli:sdk' | 'cli:git-sync' | 'cli:private-registry-migration' | 'initialSync' | 'migrate:templateFlip' | 'migrate:backup' | 'migrate:complete';
/**
 * Why setApplicationHash returned no `commitId` even though the call succeeded.
 * These are the by-design no-checkpoint paths. The dev server, which always
 * supplies a `source`, uses this to log by-design skips at info instead of
 * warning on every autosave; for it, absence of both `commitId` and this field
 * is the only genuine "checkpoint creation failed" signal. (The server-side
 * `no-source` path also returns a commit-less response without this field, but
 * the dev server never omits the source, so that case does not arise here.)
 *
 *  - 'draft-autosave' a DRAFT autosave was written inside an active draft session
 *                     (a commit exists, but its id is intentionally withheld)
 *  - 'no-changes'     the tree hash matches the last checkpoint, so nothing to commit
 *  - 'no-op-source'   the change source never produces a commit (e.g. ai:generate:pre)
 */
export type CheckpointSkipReason = 'draft-autosave' | 'no-changes' | 'no-op-source';
export declare function isSdkApiTemplate(templateName: string | null | undefined): boolean;
/**
 * The legacy template name that commits predating the per-commit `template_name`
 * column are treated as. NULL on `application_commit.template_name` means the
 * commit was created before the per-commit column existed (or by a legacy
 * write path), and must be rendered with the old YAML/shadcn code path.
 */
export declare const LEGACY_COMMIT_TEMPLATE_NAME = "shadcn-demo-app";
/**
 * Resolves the effective template name for a given commit. NULL means "legacy
 * template" (rendered as `shadcn-demo-app`); anything non-null is the explicit
 * template the commit was created against.
 *
 * Use this helper anywhere `isSdkApiTemplate` is evaluated against a commit
 * rather than the application row (e.g. when serving preview/deployed versions).
 */
export declare function effectiveCommitTemplateName(commitTemplateName: string | null | undefined): string;
/**
 * Convenience: does the commit-scoped template use the SDK API structure?
 * Equivalent to `isSdkApiTemplate(effectiveCommitTemplateName(commitTemplateName))`.
 */
export declare function isSdkApiCommitTemplate(commitTemplateName: string | null | undefined): boolean;
export {};
//# sourceMappingURL=index.d.ts.map