import { ConfigurationFile, ParsedConfigurationFile } from './configuration/types'; import { TemplateType } from '.'; import { PackageJSON } from '../types'; export type Options = { showOnHomePage?: boolean; distDir?: string; staticDeployment?: boolean; githubPagesDeploy?: boolean; popular?: boolean; extraConfigurations?: { [path: string]: ConfigurationFile; }; isTypescript?: boolean; externalResourcesEnabled?: boolean; showCube?: boolean; main?: boolean; backgroundColor?: () => string; mainFile?: string[]; defaultOpenedFile?: string[]; }; export type ConfigurationFiles = { [path: string]: ConfigurationFile; }; export type Dependencies = { [name: string]: string; }; export type ParsedConfigurationFiles = { package?: ParsedConfigurationFile; [path: string]: ParsedConfigurationFile | undefined; }; export interface ViewTab { id: string; closeable?: boolean; options?: any; hideOnEmbedPage?: boolean; hideOnPrem?: boolean; } export type ViewConfig = { open?: boolean; views: ViewTab[]; }; export default class Template { name: TemplateType; niceName: string; shortid: string; url: string; main: boolean; color: () => string; backgroundColor: () => string | undefined; popular: boolean; showOnHomePage: boolean; distDir: string; staticDeployment: boolean; githubPagesDeploy: boolean; configurationFiles: ConfigurationFiles; isTypescript: boolean; externalResourcesEnabled: boolean; showCube: boolean; isServer: boolean; mainFile: undefined | string[]; defaultOpenedFile: string[]; constructor(name: TemplateType, niceName: string, url: string, shortid: string, color: () => string, options?: Options); private getMainFromPackage; /** * Get possible entry files to evaluate, differs per template */ getEntries(configurationFiles: ParsedConfigurationFiles): string[]; /** * Files to be opened by default by the editor when opening the editor */ getDefaultOpenedFiles(configurationFiles: ParsedConfigurationFiles): string[]; /** * Get the views that are tied to the template */ getViews(configurationFiles: ParsedConfigurationFiles): ViewConfig[]; getHTMLEntries(configurationFiles: ParsedConfigurationFiles): string[]; /** * Alter the apiData to Vercel for making deployment work */ alterDeploymentData: (apiData: any) => any; }