From ccc767ce6cb50daf7a5eda3db8fd908c203aea67 Mon Sep 17 00:00:00 2001 From: Tom Seddon <-> Date: Thu, 12 Dec 2024 14:34:45 +0000 Subject: [PATCH] Fix up interface syntax. No matters arising. --- server/beebfs.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/server/beebfs.ts b/server/beebfs.ts index 7186d0c..85e923e 100644 --- a/server/beebfs.ts +++ b/server/beebfs.ts @@ -529,13 +529,13 @@ export interface IFSType { readonly name: string; // create new state for this type of FS. - createState(volume: Volume, transientSettings: unknown, persistentSettings: unknown, log: utils.Log | undefined): Promise; + createState: (volume: Volume, transientSettings: unknown, persistentSettings: unknown, log: utils.Log | undefined) => Promise; // whether this FS supports writing. - canWrite(): boolean; + canWrite: () => boolean; // get list of all Beeb files in volume. - findBeebFilesInVolume(volume: Volume, log: utils.Log | undefined): Promise; + findBeebFilesInVolume: (volume: Volume, log: utils.Log | undefined) => Promise; // Handle *LOCATE: get list of all Beeb files in volume matching explicit // parts of FQN. Treat implicit drive/dir values as matching anything. @@ -543,51 +543,51 @@ export interface IFSType { // (This entry point differs from findBeebFilesMatching in that it may // discover files that aren't directly accessible via a Beeb path, but could // become so by arrangement. TubeHost files are like this.) - locateBeebFiles(fqn: FQN, log: utils.Log | undefined): Promise; + locateBeebFiles: (fqn: FQN, log: utils.Log | undefined) => Promise; // get list of Beeb files matching FQN. The volume will be of the right type. - findBeebFilesMatching(fqn: FQN, recurse: boolean, log: utils.Log | undefined): Promise; + findBeebFilesMatching: (fqn: FQN, recurse: boolean, log: utils.Log | undefined) => Promise; // parse file/dir string, starting at index i. - parseFileString(str: string, i: number, state: IFSState | undefined, volume: Volume, volumeExplicit: boolean): FQN; - parseDirString(str: string, i: number, state: IFSState | undefined, volume: Volume, volumeExplicit: boolean): FilePath; + parseFileString: (str: string, i: number, state: IFSState | undefined, volume: Volume, volumeExplicit: boolean) => FQN; + parseDirString: (str: string, i: number, state: IFSState | undefined, volume: Volume, volumeExplicit: boolean) => FilePath; // create appropriate FSFQN from FSFSP, filling in defaults from the given State as appropriate. - //createFQN(fsp: IFSFSP, state: IFSState | undefined): IFSFQN; + //createFQN:(fsp: IFSFSP, state: IFSState | undefined)=> IFSFQN; // get ideal server path for FQN, relative to whichever volume it's in. Used // when creating a new file. - getIdealVolumeRelativeServerPath(fqn: FQN): string; + getIdealVolumeRelativeServerPath: (fqn: FQN) => string; // get *CAT text. - getCAT(filePath: FilePath, state: IFSState | undefined, log: utils.Log | undefined): Promise; + getCAT: (filePath: FilePath, state: IFSState | undefined, log: utils.Log | undefined) => Promise; // delete the given file. - deleteFile(file: File): Promise; + deleteFile: (file: File) => Promise; // rename the given file. The volume won't change. The new file doesn't // obviously exist. - renameFile(file: File, newName: FQN): Promise; + renameFile: (file: File, newName: FQN) => Promise; // write the metadata for the given file. - writeBeebMetadata(serverPath: string, fqn: FQN, load: FileAddress, exec: FileAddress, attr: FileAttributes): Promise; + writeBeebMetadata: (serverPath: string, fqn: FQN, load: FileAddress, exec: FileAddress, attr: FileAttributes) => Promise; // get new attributes from attribute string. Return undefined if invalid. - getNewAttributes(oldAttr: FileAttributes, attrString: string): FileAttributes | undefined; + getNewAttributes: (oldAttr: FileAttributes, attrString: string) => FileAttributes | undefined; // get *INFO/*EX text for the given file. Show name, attributes and // metadata. Don't append newline - that will be added automatically. - getInfoText(file: File, fileSize: number): string; + getInfoText: (file: File, fileSize: number) => string; // get *WINFO text for the given file. Don't append newline - that will be // added automatically. - getWideInfoText(file: File, stats: fs.Stats): string; + getWideInfoText: (file: File, stats: fs.Stats) => string; // get *INFO/*EX-style attributes string for the given file. // // A return value of undefined indicates that attributes aren't relevant for // the current FS. (What's the value of distinguishing this from ''? TBC...) - getAttrString(file: File): string | undefined; + getAttrString: (file: File) => string | undefined; } /////////////////////////////////////////////////////////////////////////