Extracted syscall packages

This commit is contained in:
Zef Hemel
2022-04-01 17:07:08 +02:00
parent 7f647758c2
commit 3aafa63073
34 changed files with 411 additions and 124 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import { PageMeta } from "../types";
import { FilterList, Option } from "./filter";
import { faFileLines } from "@fortawesome/free-solid-svg-icons";
import { PageMeta } from "../../common/types";
export function PageNavigator({
allPages,
+1 -1
View File
@@ -1,8 +1,8 @@
import { PageMeta } from "./types";
import { EventEmitter } from "../common/event";
import { Manifest } from "../common/manifest";
import { safeRun } from "./util";
import { Plug } from "../plugos/plug";
import { PageMeta } from "../common/types";
export type SpaceEvents = {
pageCreated: (meta: PageMeta) => void;
+3
View File
@@ -36,6 +36,9 @@ export default (editor: Editor): SysCallMapping => ({
getCursor: (): number => {
return editor.editorView!.state.selection.main.from;
},
save: async () => {
return editor.save(true);
},
navigate: async (ctx, name: string, pos: number) => {
await editor.navigate(name, pos);
},
+1 -1
View File
@@ -1,6 +1,6 @@
import { Editor } from "../editor";
import { PageMeta } from "../types";
import { SysCallMapping } from "../../plugos/system";
import { PageMeta } from "../../common/types";
export default (editor: Editor): SysCallMapping => ({
listPages: async (): Promise<PageMeta[]> => {
+1 -8
View File
@@ -1,12 +1,5 @@
import { AppCommand } from "./hooks/command";
export type PageMeta = {
name: string;
lastModified: number;
version?: number;
lastOpened?: number;
created?: boolean;
};
import { PageMeta } from "../common/types";
export const slashCommandRegexp = /\/[\w\-]*/;