Skip to content

Options configurable in Topol Options

Topol options are used to set features which topol provides.

ts
export default interface IPluginOptions {
  authorize: {
    apiKey: string;
    userId: string | number;
  };
  title?: string;
  renameTemplate?: boolean;
  removeTopBar?: boolean;
  topBarOptions?: Array<string>;
  windowBar?: Array<string>;
  mainMenuAlign?: "left" | "right";
  disableAlerts?: boolean;
  customFileManager?: boolean;
  language?: string;
  light?: boolean;
  theme?: ITheme;
  hideSettingsTab?: boolean;
  imageEditor?: boolean;
  premadeBlocks?: Object | boolean;
  savedBlocks?: Array<ISavedBlock> | boolean;
  mergeTags?: Array<IMergeTagGroup>;
  enableAutosaves?: boolean;
  htmlMinified?: boolean;
  apiAuthorizationHeader?: IAuthHeaderConfig | string;
  contentBlocks?: IContentBlockOptions[];
  callbacks: {
    onSave?(json: JSON, html: HTMLDocument): void;
    onSaveAndClose?(json: JSON, html: HTMLDocument): void;
    onTestSend?(email: string | string[], json: JSON, html: HTMLDocument): void;
    onOpenFileManager?(): void;
    onLoaded?(): void;
    onBlockSave?(block: ISavedBlock): void;
    onBlockRemove?(blockId: Number): void;
    onBlockEdit?(blockId: Number): void;
    onInit?(): void;
    onUndoChange?(count: Number): void;
    onRedoChange?(count: Number): void;
    onPreview?(html: HTMLDocument): void;
    onAlert?(notification: INotification): void;
    onClose?(): void;
    onEdittedWithoutSaveChanged?(hasUnsavedChanges: boolean): void;
    onOpenCustomBlockDialog?(customBLock: unknown): void;
    onTemplateRename?(title: string): void;
    updateTestingEmailAddresses?(emails: array[]): void;
    onError?(type: string, message: string): void;
  };
  api?: IAPI;
  mobileFirstEnabled?: boolean;
  customFonts?: {
    override?: boolean;
    fonts: Array<IFont>;
  };
  tinyConfig?: unknown;
  fontSizes?: Array<number>;

  colors?: Array<string>;
  googleApiKey?: string;
  role?: "manager" | "editor" | "reader";

  imageMaxSize?: number;
  autosaveInterval?: number;
  betaFeatures?: {
    carousel?: boolean;
  };
  imageCompressionOptions?: {
    qualityJpeg?: number;
    qualityPng?: number;
    enableAutoResize?: boolean;
    enableCompression?: boolean;
  };

  customBlocks?: CustomBlockData[];
  premadeTemplates?: boolean;
  disableAiAssistant?: boolean;
  chatAI?: boolean;
  enableImageToTextRatio?: boolean;
  showUnsavedDialogBeforeExit?: boolean;
  testingEmails: boolean | string[];

  defaultTemplateSettings?: {
    emailWidth?: number;
    emailBackgroundColor?: string;
    blockBackgroundColor?: string;
    buttonsBackgroundColor?: string;
    hyperlinkColor?: string;
    h1?: {
      [key in TopolTagAttribute]?: string;
    };
    h2?: {
      [key in TopolTagAttribute]?: string;
    };
    h3?: {
      [key in TopolTagAttribute]?: string;
    };
    p?: {
      [key in TopolTagAttribute]?: string;
    };
    button?: {
      [key in TopolTagAttribute]?: string;
    };
    "line-height"?: number;
    "structure-margin"?: string;
  };
}