alinea
Version:
[](https://npmjs.org/package/alinea) [](https://packagephobia.com/result?p=alinea)
72 lines (71 loc) • 2.77 kB
TypeScript
import { CloudAuthView } from 'alinea/cloud/view/CloudAuth';
import { ComponentType } from 'react';
import { Auth } from './Auth.js';
import { Entry } from './Entry.js';
import { Schema } from './Schema.js';
import { Type } from './Type.js';
import { Workspace, WorkspaceData } from './Workspace.js';
export interface DashboardConfig {
handlerUrl: string;
dashboardUrl: string;
auth?: Auth.View;
/** Compile all static assets for the dashboard to this dir */
staticFile?: string;
}
/** Configuration options */
export interface Config {
/** A schema describing the types of entries */
schema: Schema;
/** A record containing workspace configurations */
workspaces: Record<string, Workspace>;
/** A url which will be embedded in the dashboard for live previews */
preview?: string | ComponentType<{
entry: Entry;
previewToken: string;
}>;
/** Every edit will pass through a draft phase before being published */
enableDrafts?: boolean;
/**
publicDir?: string
dashboardFile?: string
handlerUrl?:
*/
dashboard?: DashboardConfig;
}
export declare namespace Config {
function mainWorkspace(config: Config): WorkspaceData;
function type(config: Config, name: string): Type | undefined;
function hasAuth(config: Config): boolean;
}
/** Create a new config instance */
export declare function createConfig<Definition extends Config>(definition: Definition): Definition & {
schema: {
MediaLibrary: Type<{
title: import("../input/text.js").TextField;
path: import("../input/path.js").PathField;
}>;
MediaFile: Type<{
title: import("../input/text.js").TextField;
path: import("../input/path.js").PathField;
location: import("../input/hidden.js").HiddenField<string>;
extension: import("../input/hidden.js").HiddenField<string>;
size: import("../input/hidden.js").HiddenField<number>;
hash: import("../input/hidden.js").HiddenField<string>;
width: import("../input/hidden.js").HiddenField<number>;
height: import("../input/hidden.js").HiddenField<number>;
preview: import("../input/hidden.js").HiddenField<string>;
averageColor: import("../input/hidden.js").HiddenField<string>;
focus: import("../input/hidden.js").HiddenField<{
x: number;
y: number;
}>;
thumbHash: import("../input/hidden.js").HiddenField<string>;
}>;
};
dashboard: {
handlerUrl?: string | undefined;
dashboardUrl?: string | undefined;
auth: typeof CloudAuthView | Auth.View;
staticFile?: string | undefined;
};
};