Skip to main content

Interface: ContentConfig

_internal.ContentConfig

The properties that define the content of the current project.

Hierarchy

Properties

activeEditor

activeEditor: undefined | EditorId

Selects the active editor to show.

Defaults to the last used editor for user, otherwise "markup"

Defined in

models.ts:439


cssPreset

cssPreset: CssPresetId

CSS Preset to use.

Defined in

models.ts:486


customSettings

customSettings: Object

Defines custom settings for the current project.

Type declaration

NameType
Binaryany
Cany
adocany
artany
art-templateany
asany
ascany
asciidocany
assemblyscriptany
astroany
autoprefixerany
babelany
bbany
bbcodeany
blocklyany
blockly.xmlany
cany
c++any
civetany
clangany
clang.cppany
clioany
cljany
cljcany
cljsany
clojureany
clojurescriptany
coffeeany
coffeescriptany
common-lispany
commonlispany
convertCommonjs?boolean
cpany
cppany
cpp-wasmany
cppmany
cppwasmany
csharpany
cssany
cssmodulesany
cssnanoany
cwasmany
cxxany
defaultCDN?CDN
diagramany
diagramsany
dotany
ednany
ejsany
esany
etaany
fennelany
flowany
fnlany
gleamany
goany
golangany
graphany
hany
hamlany
handlebarsany
hbsany
hppany
htmany
htmlany
iiany
imbaany
imports?Record<string, string>
ixxany
jadeany
javascriptany
jlany
jsany
jsonany
jsxany
juliaany
lessany
lightningcssany
liquidany
liquidjsany
lispany
livescriptany
lsany
luaany
lua-wasmany
luawasmany
malinaany
malinajsany
mapImports?boolean
markdownany
mdany
mdownany
mdxany
mjmlany
mkdnany
mlany
mliany
mustacheany
njkany
nunjucksany
ocamlany
perlany
pgany
pg.sqlany
pgliteany
pglite.sqlany
pgsqlany
pgsql.sqlany
phpany
php-wasmany
phpwasmany
pintoraany
plany
pltany
pmany
postcssany
postcssImportUrlany
postcssPresetEnvany
postgre.sqlany
postgresany
postgresqlany
postgresql.sqlany
prologany
prolog.plany
pugany
purgecssany
pyany
py-wasmany
py3any
pyodideany
pythonany
python-wasmany
pythonwasmany
pywasmany
rany
r-wasmany
rbany
reany
react-nativeany
react-native-tsxany
react-native.jsxany
react-native.tsxany
reasonany
reiany
resany
rescriptany
resiany
richany
richtextany
riotany
riotjsany
rlangany
rstatsany
rteany
rte.htmlany
rubyany
ruby-wasmany
rubywasmany
sassany
schemeany
scmany
scriptType?"" | "module" | "text/liquid" | "text/python" | "text/r" | "text/ruby-wasm" | "text/x-uniter-php" | "text/php-wasm" | "text/cpp" | "text/perl" | "text/julia" | "text/biwascheme" | "text/commonlisp" | "text/tcl" | "text/prolog" | "application/json" | "application/lua" | "text/fennel" | "application/wasm-uint8" | "application/javascript" | "application/ecmascript" | "text/javascript" | "text/ecmascript"
scssany
solidany
solid.jsxany
solid.tsxany
sqlany
sqliteany
sqlite3any
stencilany
stencil.tsxany
stylany
stylisany
stylusany
sucraseany
svelteany
tailwindcssany
tclany
tealany
template?{ data?: any ; prerender?: boolean }
template.data?any
template.prerender?boolean
tlany
tokencssany
tsany
tsxany
twigany
types?Types
typescriptany
unocssany
ventoany
vtoany
vueany
vue2any
vue3any
wasmany
wasm.cppany
wasm.luaany
wasm.phpany
wasm.pyany
wasm.rbany
wastany
watany
webassemblyany
windicssany
xhtany
xmlany

Defined in

models.ts:498


description

description: string

Project description. Used in project search and result page description meta tag.

Default

""

Defined in

models.ts:409


head: string

Content added to the result page <head> element.

Default

'<meta charset="UTF-8" />\n<meta name="viewport" content="width=device-width, initial-scale=1.0" />'

Defined in

models.ts:415


htmlAttrs

htmlAttrs: string | Record<string, string>

Attributes added to the result page <html> element. It can be an object or a string.

Example

{ lang: "en", class: "dark" }
'lang="en" class="dark"'

Defined in

models.ts:424


imports

imports: Object

Allows specifying custom import maps for module imports.

Example

Setting imports like this:

"imports": {
"moment": "https://cdn.jsdelivr.net/npm/[email protected]/dist/moment.js"
}

results in the following import map:

<script type="importmap">
{
"imports": {
"moment": "https://cdn.jsdelivr.net/npm/[email protected]/dist/moment.js"
}
}
</script>

See docs for Imports and Custom Module Resolution

Index signature

[key: string]: string

Defined in

models.ts:524


languages

languages: undefined | ("reason" | "stylus" | "r" | "html" | "ruby" | "rb" | "json" | "teal" | "solid" | "flow" | "dot" | "as" | "go" | "htm" | "markdown" | "md" | "mdown" | "mkdn" | "mdx" | "astro" | "pug" | "jade" | "haml" | "asciidoc" | "adoc" | "asc" | "mustache" | "handlebars" | "hbs" | "ejs" | "eta" | "nunjucks" | "njk" | "liquid" | "liquidjs" | "twig" | "vento" | "vto" | "art-template" | "art" | "bbcode" | "bb" | "mjml" | "diagrams" | "diagram" | "graph" | "plt" | "richtext" | "rte" | "rich" | "rte.html" | "css" | "scss" | "sass" | "less" | "styl" | "stylis" | "postcss" | "javascript" | "js" | "babel" | "es" | "sucrase" | "typescript" | "ts" | "jsx" | "tsx" | "react-native" | "react-native.jsx" | "react-native-tsx" | "react-native.tsx" | "vue" | "vue3" | "vue2" | "svelte" | "stencil" | "stencil.tsx" | "solid.jsx" | "solid.tsx" | "riot" | "riotjs" | "malina" | "malinajs" | "xht" | "coffeescript" | "coffee" | "livescript" | "ls" | "civet" | "clio" | "imba" | "assemblyscript" | "python" | "py" | "pyodide" | "python-wasm" | "py-wasm" | "pythonwasm" | "pywasm" | "py3" | "wasm.py" | "rlang" | "rstats" | "r-wasm" | "ruby-wasm" | "wasm.rb" | "rubywasm" | "golang" | "php" | "php-wasm" | "phpwasm" | "wasm.php" | "cpp" | "c" | "C" | "cp" | "cxx" | "c++" | "cppm" | "ixx" | "ii" | "hpp" | "h" | "cpp-wasm" | "cppwasm" | "cwasm" | "wasm.cpp" | "clang" | "clang.cpp" | "perl" | "pl" | "pm" | "lua" | "lua-wasm" | "luawasm" | "wasm.lua" | "tl" | "fennel" | "fnl" | "julia" | "jl" | "scheme" | "scm" | "commonlisp" | "common-lisp" | "lisp" | "clojurescript" | "clojure" | "cljs" | "clj" | "cljc" | "edn" | "gleam" | "rescript" | "res" | "resi" | "re" | "rei" | "ocaml" | "ml" | "mli" | "tcl" | "wat" | "wast" | "webassembly" | "wasm" | "Binary" | "csharp" | "sql" | "sqlite" | "sqlite3" | "pg.sql" | "pgsql.sql" | "pgsql" | "pg" | "pglite" | "pglite.sql" | "postgresql" | "postgres" | "postgre.sql" | "postgresql.sql" | "prolog.pl" | "prolog" | "blockly" | "blockly.xml" | "xml" | "pintora" | "tailwindcss" | "postcssImportUrl" | "windicss" | "unocss" | "tokencss" | "lightningcss" | "autoprefixer" | "postcssPresetEnv" | "cssmodules" | "purgecss" | "cssnano")[]

List of enabled languages.

Defaults to all supported languages in full app and only current editor languages in embeds.

Defined in

models.ts:446


markup

markup: Object

An object that configures the language and content of the markup editor.

See docs for details.

Default

{ language: "html", content: "" }

Type declaration

NameTypeDescription
content?stringThe initial content of the code editor. Default ts ""
contentUrl?stringA URL to load content from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if content property had no value.
hiddenContent?stringHidden content that gets evaluated without being visible in the code editor. This can be useful in embedded playgrounds (e.g. for adding helper functions, utilities or tests)
hiddenContentUrl?stringA URL to load hiddenContent from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if hiddenContent property had no value.
languageLanguageA language name, extension or alias (as defined in language documentations). For the list of supported values, see Language
position?EditorPositionThe initial position of the cursor in the code editor. Example ts {lineNumber: 5, column: 10}
selector?stringA CSS selector to load content from DOM import.
title?stringIf set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").

Defined in

models.ts:454


processors

processors: Processor[]

List of enabled CSS processors.

For the list of available processors, see Processor

Defined in

models.ts:493


script

script: Object

An object that configures the language and content of the script editor.

See docs for details.

Default

{ language: "javascript", content: "" }

Type declaration

NameTypeDescription
content?stringThe initial content of the code editor. Default ts ""
contentUrl?stringA URL to load content from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if content property had no value.
hiddenContent?stringHidden content that gets evaluated without being visible in the code editor. This can be useful in embedded playgrounds (e.g. for adding helper functions, utilities or tests)
hiddenContentUrl?stringA URL to load hiddenContent from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if hiddenContent property had no value.
languageLanguageA language name, extension or alias (as defined in language documentations). For the list of supported values, see Language
position?EditorPositionThe initial position of the cursor in the code editor. Example ts {lineNumber: 5, column: 10}
selector?stringA CSS selector to load content from DOM import.
title?stringIf set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").

Defined in

models.ts:470


scripts

scripts: string[]

List of URLs for external scripts to add to the result page.

Defined in

models.ts:480


style

style: Object

An object that configures the language and content of the style editor.

See docs for details.

Default

{ language: "css", content: "" }

Type declaration

NameTypeDescription
content?stringThe initial content of the code editor. Default ts ""
contentUrl?stringA URL to load content from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if content property had no value.
hiddenContent?stringHidden content that gets evaluated without being visible in the code editor. This can be useful in embedded playgrounds (e.g. for adding helper functions, utilities or tests)
hiddenContentUrl?stringA URL to load hiddenContent from. It has to be a valid URL that is CORS-enabled. The URL is only fetched if hiddenContent property had no value.
languageLanguageA language name, extension or alias (as defined in language documentations). For the list of supported values, see Language
position?EditorPositionThe initial position of the cursor in the code editor. Example ts {lineNumber: 5, column: 10}
selector?stringA CSS selector to load content from DOM import.
title?stringIf set, this is used as the title of the editor in the UI, overriding the default title set to the language name (e.g. "Python" can be used instead of "Py (Wasm)").

Defined in

models.ts:462


stylesheets

stylesheets: string[]

List of URLs for external stylesheets to add to the result page.

Defined in

models.ts:475


tags

tags: string[]

Project tags. Used in project filter and search.

Default

[]

Defined in

models.ts:431


tests

tests: undefined | { content?: string ; contentUrl?: string ; hiddenContent?: string ; hiddenContentUrl?: string ; language?: Language ; position?: EditorPosition ; selector?: string ; title?: string }

Configures the language and content of tests.

Defined in

models.ts:560


title

title: string

Project title. This is used as result page title and title meta tag. Also used in project search.

Default

"Untitled Project"

Defined in

models.ts:402


types

types: Object

Allows providing custom TypeScript type declarations for better editor intellisense.

It is an object where each key represents module name and value represents the types.

See docs for Types and Custom Types

Example

{
"types": {
"my-demo-lib": "https://my-custom-domain/my-type-declarations.d.ts"
}
}

Example

{
"types": {
"my-demo-lib": {
"url": "https://my-custom-domain/types.d.ts",
"autoload": true,
"declareAsModule": true
}
}

Defined in

models.ts:554


version

Readonly version: string

This is a read-only property which specifies the current LiveCodes version.

Version specified in exported projects allows automatically upgrading the project configuration when imported by an app with a newer version.

Defined in

models.ts:567