UNPKG

@appsemble/lang-sdk

Version:

Language SDK for Appsemble

26 lines (25 loc) 1.45 kB
import { type ValidatorResult } from 'jsonschema'; import { type Promisable } from 'type-fest'; import { type IdentifiableBlock } from './blockUtils.js'; import { type AppDefinition, type BlockManifest, type ProjectImplementations, type Remapper } from './types/index.js'; /** * Check whether or not the given link represents a link related to the Appsemble core. * * @param link The link to check * @returns Whether or not the given link represents a link related to the Appsemble core. */ export declare function isAppLink(link: Remapper | string[] | string): boolean; export type BlockVersionsGetter = (blockMap: IdentifiableBlock[]) => Promisable<BlockManifest[]>; /** * Validate an app definition. * * This check various conditions which can’t be validated using basic JSON schema validation. * * @param definition The app validation to check. * @param getBlockVersions A function for getting block manifests from block versions. * @param controllerImplementations App controller implementations of interfaces. * @param validatorResult If specified, error messages will be applied to this existing validator * result. * @returns A validator result which contains all app validation violations. */ export declare function validateAppDefinition(definition: AppDefinition, getBlockVersions: BlockVersionsGetter, controllerImplementations?: ProjectImplementations, validatorResult?: ValidatorResult): Promise<ValidatorResult>;