mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) move home server into core
Summary: This moves enough server material into core to run a home server. The data engine is not yet incorporated (though in manual testing it works when ported). Test Plan: existing tests pass Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2552
This commit is contained in:
77
app/common/plugin.ts
Normal file
77
app/common/plugin.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Plugin's utilities common to server and client.
|
||||
*/
|
||||
import {BarePlugin, Implementation} from 'app/plugin/PluginManifest';
|
||||
|
||||
export type LocalPluginKind = "installed"|"builtIn";
|
||||
|
||||
export interface ImplDescription {
|
||||
localPluginId: string;
|
||||
implementation: Implementation;
|
||||
}
|
||||
|
||||
export interface FileParser {
|
||||
fileExtensions: string[];
|
||||
parseOptions?: ImplDescription;
|
||||
fileParser: ImplDescription;
|
||||
}
|
||||
|
||||
// Deprecated, use FileParser or ImportSource instead.
|
||||
export interface FileImporter {
|
||||
id: string;
|
||||
fileExtensions?: string[];
|
||||
script?: string;
|
||||
scriptFullPath?: string;
|
||||
filePicker?: string;
|
||||
filePickerFullPath?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manifest parsing error.
|
||||
*/
|
||||
export interface ManifestParsingError {
|
||||
yamlError?: any;
|
||||
jsonError?: any;
|
||||
cannotReadError?: any;
|
||||
missingEntryErrors?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the importer provides a file picker.
|
||||
*/
|
||||
export function isPicker(importer: FileImporter): boolean {
|
||||
return importer.filePicker !== undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Plugin that was found in the system, either installed or builtin.
|
||||
*/
|
||||
export interface LocalPlugin {
|
||||
/**
|
||||
* the plugin's manifest
|
||||
*/
|
||||
manifest: BarePlugin;
|
||||
/**
|
||||
* The path to the plugin's folder.
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* A name to uniquely identify a LocalPlugin.
|
||||
*/
|
||||
readonly id: string;
|
||||
}
|
||||
|
||||
export interface DirectoryScanEntry {
|
||||
manifest?: BarePlugin;
|
||||
/**
|
||||
* User-friendly error messages.
|
||||
*/
|
||||
errors?: any[];
|
||||
path: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The contributions type.
|
||||
*/
|
||||
export type Contribution = "importSource" | "fileParser";
|
||||
Reference in New Issue
Block a user