Files
plainleaf/type/index.ts
T
Zef HemelandGitHub dc2987a3f9 Sync engine rearchitecture (#1516)
* Don't require auth for .ping
* Finally introducing loggers
* Remove file list caching from disk_space_primitives
I don't think this is required anymore with the sync model
* Simplification of space primitives and more tests
* More reliable online status
* Add .zed settings
* Remove selfUpdate argument from `writeFile` no longer used
- Add `sync` config schema and document sync options
- Move sync config handling to client boot logic
- Move BootConfig type to ui_types.ts
- Remove sync env vars from server
- Update documentation for sync and architecture
* Improve sync logic and proxy routing for full sync state
* Add BoxProxy for late-bound client and improve Lua boot
- Add isMobile syscall for editor
* Add concurrency to sync process and log indexing duration
* Better service worker lifecycle management
2025-09-12 14:43:57 +02:00

56 lines
1.3 KiB
TypeScript

export type FileMeta = {
name: string;
created: number;
lastModified: number;
contentType: string;
size: number;
perm: "ro" | "rw";
};
/**
* Decorates a page when it matches certain criteria
*/
export type PageDecoration = {
prefix?: string;
cssClasses?: string[];
hide?: boolean;
renderWidgets?: boolean; // Defaults to true
};
export type PageMeta = ObjectValue<
{
name: string;
created: string; // indexing it as a string
lastModified: string; // indexing it as a string
perm: "ro" | "rw";
lastOpened?: number;
pageDecoration?: PageDecoration;
} & Record<string, any>
>;
export type DocumentMeta = ObjectValue<
{
name: string;
contentType: string;
created: string;
lastModified: string;
size: number;
perm: "ro" | "rw";
extension: string;
} & Record<string, any>
>;
export type SyscallMeta = {
name: string;
requiredPermissions: string[];
argCount: number;
};
/**
* An ObjectValue that can be indexed by the `index` plug, needs to have a minimum of
* of two fields:
* - ref: a unique reference (id) for the object, ideally a page reference
* - tags: a list of tags that the object belongs to
*/
export type ObjectValue<T> = {
ref: string;
tag: string; // main tag
tags?: string[];
itags?: string[]; // implicit or inherited tags (inherited from the page for instance)
} & T;