Initial commit: notification-elements-demo app

Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Giuliano Silvestro
2026-02-13 21:49:19 +10:00
commit 5d0c9ec7eb
36473 changed files with 3778146 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
import { CoreFileSystemHandle } from './CoreFileSystemHandle';
import type { CoreFsaContext, GetDirectoryHandleOptions, GetFileHandleOptions, IFileSystemDirectoryHandle, IFileSystemFileHandle, IFileSystemHandle, RemoveEntryOptions } from './types';
import type { Superblock } from '@jsonjoy.com/fs-core';
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle
*/
export declare class CoreFileSystemDirectoryHandle extends CoreFileSystemHandle implements IFileSystemDirectoryHandle {
protected readonly _core: Superblock;
protected readonly ctx: CoreFsaContext;
/** Directory path with trailing slash. */
readonly __path: string;
constructor(_core: Superblock, path: string, ctx?: Partial<CoreFsaContext>);
/**
* Returns a new array iterator containing the keys for each item in
* {@link CoreFileSystemDirectoryHandle} object.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/keys
*/
keys(): AsyncIterableIterator<string>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/entries
*/
entries(): AsyncIterableIterator<[string, CoreFileSystemHandle]>;
/**
* Returns a new array iterator containing the values for each index in the
* {@link FileSystemDirectoryHandle} object.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/values
*/
values(): AsyncIterableIterator<CoreFileSystemHandle>;
/**
* Returns a {@link CoreFileSystemDirectoryHandle} for a subdirectory with the specified
* name within the directory handle on which the method is called.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle
* @param name A string representing the {@link CoreFileSystemHandle} name of
* the subdirectory you wish to retrieve.
* @param options An optional object containing options for the retrieved
* subdirectory.
*/
getDirectoryHandle(name: string, options?: GetDirectoryHandleOptions): Promise<IFileSystemDirectoryHandle>;
/**
* Returns a {@link CoreFileSystemFileHandle} for a file with the specified name,
* within the directory the method is called.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle
* @param name A string representing the {@link CoreFileSystemHandle} name of
* the file you wish to retrieve.
* @param options An optional object containing options for the retrieved file.
*/
getFileHandle(name: string, options?: GetFileHandleOptions): Promise<IFileSystemFileHandle>;
/**
* Attempts to remove an entry if the directory handle contains a file or
* directory called the name specified.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry
* @param name A string representing the {@link CoreFileSystemHandle} name of the
* entry you wish to remove.
* @param options An optional object containing options.
*/
removeEntry(name: string, { recursive }?: RemoveEntryOptions): Promise<void>;
/**
* The `resolve()` method of the {@link FileSystemDirectoryHandle} interface
* returns an {@link Array} of directory names from the parent handle to the specified
* child entry, with the name of the child entry as the last array item.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/resolve
* @param possibleDescendant The {@link CoreFileSystemHandle} from which
* to return the relative path.
*/
resolve(possibleDescendant: IFileSystemHandle): Promise<string[] | null>;
private _handleError;
}

View File

@@ -0,0 +1,265 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileSystemDirectoryHandle = void 0;
const CoreFileSystemHandle_1 = require("./CoreFileSystemHandle");
const util_1 = require("./util");
const CoreFileSystemFileHandle_1 = require("./CoreFileSystemFileHandle");
const buffer_1 = require("@jsonjoy.com/fs-node-builtins/lib/internal/buffer");
const fs_node_utils_1 = require("@jsonjoy.com/fs-node-utils");
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle
*/
class CoreFileSystemDirectoryHandle extends CoreFileSystemHandle_1.CoreFileSystemHandle {
constructor(_core, path, ctx = {}) {
const fullCtx = (0, util_1.ctx)(ctx);
super('directory', (0, util_1.basename)(path, fullCtx.separator), fullCtx);
this._core = _core;
this.ctx = fullCtx;
this.__path = path[path.length - 1] === this.ctx.separator ? path : path + this.ctx.separator;
}
/**
* Returns a new array iterator containing the keys for each item in
* {@link CoreFileSystemDirectoryHandle} object.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/keys
*/
async *keys() {
try {
const link = this._core.getResolvedLinkOrThrow(this.__path);
const children = link.children;
for (const [name] of children) {
if (name !== '.' && name !== '..') {
yield name;
}
}
}
catch (error) {
this._handleError(error, 'keys');
}
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/entries
*/
async *entries() {
const { __path: path, _core, ctx } = this;
try {
const link = _core.getResolvedLinkOrThrow(path);
const children = link.children;
for (const [name, childLink] of children) {
if (name !== '.' && name !== '..' && childLink) {
const childPath = path + name;
const node = childLink.getNode();
if (node.isDirectory()) {
yield [name, new CoreFileSystemDirectoryHandle(_core, childPath, ctx)];
}
else if (node.isFile()) {
yield [name, new CoreFileSystemFileHandle_1.CoreFileSystemFileHandle(_core, childPath, ctx)];
}
}
}
}
catch (error) {
this._handleError(error, 'entries');
}
}
/**
* Returns a new array iterator containing the values for each index in the
* {@link FileSystemDirectoryHandle} object.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/values
*/
async *values() {
for await (const [, value] of this.entries())
yield value;
}
/**
* Returns a {@link CoreFileSystemDirectoryHandle} for a subdirectory with the specified
* name within the directory handle on which the method is called.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle
* @param name A string representing the {@link CoreFileSystemHandle} name of
* the subdirectory you wish to retrieve.
* @param options An optional object containing options for the retrieved
* subdirectory.
*/
async getDirectoryHandle(name, options) {
(0, util_1.assertName)(name, 'getDirectoryHandle', 'FileSystemDirectoryHandle');
const filename = this.__path + name;
try {
const link = this._core.getResolvedLink(filename);
if (link) {
const node = link.getNode();
if (!node.isDirectory())
throw (0, util_1.newTypeMismatchError)();
return new CoreFileSystemDirectoryHandle(this._core, filename, this.ctx);
}
else {
throw new Error('ENOENT'); // Simulate error for consistency with catch block
}
}
catch (error) {
if (error instanceof DOMException)
throw error;
if (error && typeof error === 'object') {
if (error.code === "ENOENT" /* ERROR_CODE.ENOENT */ || error.message === 'ENOENT') {
if (options?.create) {
(0, util_1.assertCanWrite)(this.ctx.mode);
try {
this._core.mkdir(filename, 0o755);
return new CoreFileSystemDirectoryHandle(this._core, filename, this.ctx);
}
catch (createError) {
if (createError && typeof createError === 'object' && createError.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw createError;
}
}
throw (0, util_1.newNotFoundError)();
}
if (error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
}
throw error;
}
}
/**
* Returns a {@link CoreFileSystemFileHandle} for a file with the specified name,
* within the directory the method is called.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/getFileHandle
* @param name A string representing the {@link CoreFileSystemHandle} name of
* the file you wish to retrieve.
* @param options An optional object containing options for the retrieved file.
*/
async getFileHandle(name, options) {
(0, util_1.assertName)(name, 'getFileHandle', 'FileSystemDirectoryHandle');
const filename = this.__path + name;
try {
const link = this._core.getResolvedLink(filename);
if (link) {
const node = link.getNode();
if (!node.isFile())
throw (0, util_1.newTypeMismatchError)();
return new CoreFileSystemFileHandle_1.CoreFileSystemFileHandle(this._core, filename, this.ctx);
}
else {
throw new Error('ENOENT'); // Simulate error for consistency with catch block
}
}
catch (error) {
if (error instanceof DOMException)
throw error;
if (error && typeof error === 'object') {
if (error.code === "ENOENT" /* ERROR_CODE.ENOENT */ || error.message === 'ENOENT') {
if (options?.create) {
(0, util_1.assertCanWrite)(this.ctx.mode);
try {
this._core.writeFile(filename, buffer_1.Buffer.alloc(0), fs_node_utils_1.FLAGS.w, 438 /* MODE.FILE */);
return new CoreFileSystemFileHandle_1.CoreFileSystemFileHandle(this._core, filename, this.ctx);
}
catch (createError) {
if (createError && typeof createError === 'object' && createError.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw createError;
}
}
throw (0, util_1.newNotFoundError)();
}
if (error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
}
throw error;
}
}
/**
* Attempts to remove an entry if the directory handle contains a file or
* directory called the name specified.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/removeEntry
* @param name A string representing the {@link CoreFileSystemHandle} name of the
* entry you wish to remove.
* @param options An optional object containing options.
*/
async removeEntry(name, { recursive = false } = {}) {
(0, util_1.assertCanWrite)(this.ctx.mode);
(0, util_1.assertName)(name, 'removeEntry', 'FileSystemDirectoryHandle');
const filename = this.__path + name;
try {
const link = this._core.getResolvedLinkOrThrow(filename);
const node = link.getNode();
if (node.isFile()) {
this._core.unlink(filename);
}
else if (node.isDirectory()) {
this._core.rmdir(filename, recursive);
}
else {
throw (0, util_1.newTypeMismatchError)();
}
}
catch (error) {
if (error instanceof DOMException)
throw error;
if (error && typeof error === 'object') {
switch (error.code) {
case "ENOENT" /* ERROR_CODE.ENOENT */: {
throw (0, util_1.newNotFoundError)();
}
case "EACCES" /* ERROR_CODE.EACCES */:
throw (0, util_1.newNotAllowedError)();
case "ENOTEMPTY" /* ERROR_CODE.ENOTEMPTY */:
throw new DOMException('The object can not be modified in this way.', 'InvalidModificationError');
}
}
throw error;
}
}
/**
* The `resolve()` method of the {@link FileSystemDirectoryHandle} interface
* returns an {@link Array} of directory names from the parent handle to the specified
* child entry, with the name of the child entry as the last array item.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryHandle/resolve
* @param possibleDescendant The {@link CoreFileSystemHandle} from which
* to return the relative path.
*/
async resolve(possibleDescendant) {
if (possibleDescendant instanceof CoreFileSystemDirectoryHandle ||
possibleDescendant instanceof CoreFileSystemFileHandle_1.CoreFileSystemFileHandle) {
// First check if they are from the same core instance
if (possibleDescendant._core !== this._core)
return null;
const path = this.__path;
const childPath = possibleDescendant.__path;
if (!childPath.startsWith(path))
return null;
let relative = childPath.slice(path.length);
if (relative === '')
return [];
const separator = this.ctx.separator;
if (relative[0] === separator)
relative = relative.slice(1);
return relative.split(separator);
}
return null;
}
_handleError(error, method) {
if (error instanceof DOMException)
throw error;
if (error && typeof error === 'object') {
switch (error.code) {
case "ENOENT" /* ERROR_CODE.ENOENT */:
throw (0, util_1.newNotFoundError)();
case "EACCES" /* ERROR_CODE.EACCES */:
throw (0, util_1.newNotAllowedError)();
}
}
throw error;
}
}
exports.CoreFileSystemDirectoryHandle = CoreFileSystemDirectoryHandle;
//# sourceMappingURL=CoreFileSystemDirectoryHandle.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,25 @@
import { CoreFileSystemHandle } from './CoreFileSystemHandle';
import { CoreFileSystemWritableFileStream } from './CoreFileSystemWritableFileStream';
import type { CoreFsaContext, CreateWritableOptions, IFileSystemFileHandle, IFileSystemSyncAccessHandle } from './types';
import type { Superblock } from '@jsonjoy.com/fs-core';
export declare class CoreFileSystemFileHandle extends CoreFileSystemHandle implements IFileSystemFileHandle {
protected readonly _core: Superblock;
readonly __path: string;
protected readonly ctx: CoreFsaContext;
constructor(_core: Superblock, __path: string, ctx?: Partial<CoreFsaContext>);
/**
* Returns a {@link Promise} which resolves to a {@link File} object
* representing the state on disk of the entry represented by the handle.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/getFile
*/
getFile(): Promise<File>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createSyncAccessHandle
*/
get createSyncAccessHandle(): undefined | (() => Promise<IFileSystemSyncAccessHandle>);
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable
*/
createWritable({ keepExistingData }?: CreateWritableOptions): Promise<CoreFileSystemWritableFileStream>;
}

View File

@@ -0,0 +1,75 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileSystemFileHandle = void 0;
const CoreFileSystemHandle_1 = require("./CoreFileSystemHandle");
const CoreFileSystemSyncAccessHandle_1 = require("./CoreFileSystemSyncAccessHandle");
const util_1 = require("./util");
const CoreFileSystemWritableFileStream_1 = require("./CoreFileSystemWritableFileStream");
class CoreFileSystemFileHandle extends CoreFileSystemHandle_1.CoreFileSystemHandle {
constructor(_core, __path, ctx = {}) {
const fullCtx = (0, util_1.ctx)(ctx);
super('file', (0, util_1.basename)(__path, fullCtx.separator), fullCtx);
this._core = _core;
this.__path = __path;
this.ctx = fullCtx;
}
/**
* Returns a {@link Promise} which resolves to a {@link File} object
* representing the state on disk of the entry represented by the handle.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/getFile
*/
async getFile() {
try {
const path = this.__path;
const link = this._core.getResolvedLinkOrThrow(path);
const node = link.getNode();
if (!node.isFile()) {
throw new Error('Not a file');
}
// Get file stats for lastModified
const lastModified = node.mtime ? node.mtime.getTime() : Date.now();
// Read file content
const buffer = node.getBuffer();
const data = new Uint8Array(buffer);
const file = new File([data], this.name, { lastModified });
return file;
}
catch (error) {
if (error instanceof DOMException)
throw error;
if (error && typeof error === 'object') {
switch (error.code) {
case "EACCES" /* ERROR_CODE.EACCES */:
throw (0, util_1.newNotAllowedError)();
}
}
throw error;
}
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createSyncAccessHandle
*/
get createSyncAccessHandle() {
if (!this.ctx.syncHandleAllowed)
return undefined;
return async () => {
if (this.ctx.locks.isLocked(this.__path)) {
throw (0, util_1.newNoModificationAllowedError)();
}
return new CoreFileSystemSyncAccessHandle_1.CoreFileSystemSyncAccessHandle(this._core, this.__path, this.ctx);
};
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable
*/
async createWritable({ keepExistingData = false } = { keepExistingData: false }) {
(0, util_1.assertCanWrite)(this.ctx.mode);
if (this.ctx.locks.isLocked(this.__path)) {
throw (0, util_1.newNoModificationAllowedError)();
}
return new CoreFileSystemWritableFileStream_1.CoreFileSystemWritableFileStream(this._core, this.__path, keepExistingData, this.ctx);
}
}
exports.CoreFileSystemFileHandle = CoreFileSystemFileHandle;
//# sourceMappingURL=CoreFileSystemFileHandle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CoreFileSystemFileHandle.js","sourceRoot":"","sources":["../src/CoreFileSystemFileHandle.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,qFAAkF;AAClF,iCAAuH;AACvH,yFAAsF;AAUtF,MAAa,wBAAyB,SAAQ,2CAAoB;IAGhE,YACqB,KAAiB,EACpB,MAAc,EAC9B,MAA+B,EAAE;QAEjC,MAAM,OAAO,GAAG,IAAA,UAAS,EAAC,GAAG,CAAC,CAAC;QAC/B,KAAK,CAAC,MAAM,EAAE,IAAA,eAAQ,EAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC;QALzC,UAAK,GAAL,KAAK,CAAY;QACpB,WAAM,GAAN,MAAM,CAAQ;QAK9B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IACrB,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,OAAO;QAClB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;YACzB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;YACrD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;YAE5B,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;YAChC,CAAC;YAED,kCAAkC;YAClC,MAAM,YAAY,GAAG,IAAI,C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AK,EAAE;QAEjF,IAAA,qBAAc,EAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YACzC,MAAM,IAAA,oCAA6B,GAAE,CAAC;QACxC,CAAC;QACD,OAAO,IAAI,mEAAgC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACnG,CAAC;CACF;AA3ED,4DA2EC"}

View File

@@ -0,0 +1,34 @@
import { CorePermissionStatus } from './CorePermissionStatus';
import type { IFileSystemHandle, FileSystemHandlePermissionDescriptor, CoreFsaContext } from './types';
/**
* Represents a File System Access API file handle `FileSystemHandle` object,
* which was created from a core `Superblock`.
*
* @see [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle)
*/
export declare abstract class CoreFileSystemHandle implements IFileSystemHandle {
readonly kind: 'file' | 'directory';
readonly name: string;
protected readonly ctx: CoreFsaContext;
constructor(kind: 'file' | 'directory', name: string, ctx: CoreFsaContext);
/**
* Compares two handles to see if the associated entries (either a file or directory) match.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/isSameEntry
*/
isSameEntry(fileSystemHandle: CoreFileSystemHandle): boolean;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/queryPermission
*/
queryPermission(fileSystemHandlePermissionDescriptor: FileSystemHandlePermissionDescriptor): Promise<CorePermissionStatus>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/remove
*/
remove({ recursive }?: {
recursive?: boolean;
}): Promise<void>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/requestPermission
*/
requestPermission(fileSystemHandlePermissionDescriptor: FileSystemHandlePermissionDescriptor): CorePermissionStatus;
}

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileSystemHandle = void 0;
const CorePermissionStatus_1 = require("./CorePermissionStatus");
/**
* Represents a File System Access API file handle `FileSystemHandle` object,
* which was created from a core `Superblock`.
*
* @see [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle)
*/
class CoreFileSystemHandle {
constructor(kind, name, ctx) {
this.kind = kind;
this.name = name;
this.ctx = ctx;
}
/**
* Compares two handles to see if the associated entries (either a file or directory) match.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/isSameEntry
*/
isSameEntry(fileSystemHandle) {
return (this.constructor === fileSystemHandle.constructor && this.__path === fileSystemHandle.__path);
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/queryPermission
*/
async queryPermission(fileSystemHandlePermissionDescriptor) {
// Check if the requested mode is compatible with the context mode
const requestedMode = fileSystemHandlePermissionDescriptor.mode;
const contextMode = this.ctx.mode;
// If requesting readwrite but context only allows read, deny
if (requestedMode === 'readwrite' && contextMode === 'read') {
return new CorePermissionStatus_1.CorePermissionStatus('denied', requestedMode);
}
// Otherwise grant the permission
return new CorePermissionStatus_1.CorePermissionStatus('granted', requestedMode);
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/remove
*/
async remove({ recursive } = { recursive: false }) {
throw new Error('Not implemented');
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemHandle/requestPermission
*/
requestPermission(fileSystemHandlePermissionDescriptor) {
throw new Error('Not implemented');
}
}
exports.CoreFileSystemHandle = CoreFileSystemHandle;
//# sourceMappingURL=CoreFileSystemHandle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CoreFileSystemHandle.js","sourceRoot":"","sources":["../src/CoreFileSystemHandle.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAG9D;;;;;GAKG;AACH,MAAsB,oBAAoB;IAGxC,YACkB,IAA0B,EAC1B,IAAY,EAC5B,GAAmB;QAFH,SAAI,GAAJ,IAAI,CAAsB;QAC1B,SAAI,GAAJ,IAAI,CAAQ;QAG5B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACI,WAAW,CAAC,gBAAsC;QACvD,OAAO,CACL,IAAI,CAAC,WAAW,KAAK,gBAAgB,CAAC,WAAW,IAAK,IAAY,CAAC,MAAM,KAAM,gBAAwB,CAAC,MAAM,CAC/G,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,eAAe,CAC1B,oCAA0E;QAE1E,kEAAkE;QAClE,MAAM,aAAa,GAAG,oCAAoC,CAAC,IAAI,CAAC;QAChE,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;QAElC,6DAA6D;QAC7D,IAAI,aAAa,KAAK,WAAW,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;YAC5D,OAAO,IAAI,2CAAoB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;QAC3D,CAAC;QAED,iCAAiC;QACjC,OAAO,IAAI,2CAAoB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,MAAM,CAAC,EAAE,SAAS,KAA8B,EAAE,SAAS,EAAE,KAAK,EAAE;QAC/E,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED;;OAEG;IACI,iBAAiB,CACtB,oCAA0E;QAE1E,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;CACF;AAxDD,oDAwDC"}

View File

@@ -0,0 +1,10 @@
import type { IFileSystemChangeRecord, IFileSystemDirectoryHandle, IFileSystemFileHandle, IFileSystemObserver, IFileSystemObserverObserveOptions, IFileSystemSyncAccessHandle } from './types';
import type { Superblock } from '@jsonjoy.com/fs-core';
export declare class CoreFileSystemObserver implements IFileSystemObserver {
protected readonly _core: Superblock;
protected readonly callback: (records: IFileSystemChangeRecord[], observer: IFileSystemObserver) => void;
constructor(_core: Superblock, callback: (records: IFileSystemChangeRecord[], observer: IFileSystemObserver) => void);
observe(handle: IFileSystemFileHandle | IFileSystemDirectoryHandle | IFileSystemSyncAccessHandle, options?: IFileSystemObserverObserveOptions): Promise<void>;
/** Disconnect and stop all observations. */
disconnect(): void;
}

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileSystemObserver = void 0;
class CoreFileSystemObserver {
constructor(_core, callback) {
this._core = _core;
this.callback = callback;
}
async observe(handle, options) {
throw new Error('Method not implemented.');
}
/** Disconnect and stop all observations. */
disconnect() {
throw new Error('Method not implemented.');
}
}
exports.CoreFileSystemObserver = CoreFileSystemObserver;
//# sourceMappingURL=CoreFileSystemObserver.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CoreFileSystemObserver.js","sourceRoot":"","sources":["../src/CoreFileSystemObserver.ts"],"names":[],"mappings":";;;AAUA,MAAa,sBAAsB;IACjC,YACqB,KAAiB,EACjB,QAAqF;QADrF,UAAK,GAAL,KAAK,CAAY;QACjB,aAAQ,GAAR,QAAQ,CAA6E;IACvG,CAAC;IAEG,KAAK,CAAC,OAAO,CAClB,MAAwF,EACxF,OAA2C;QAE3C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,4CAA4C;IACrC,UAAU;QACf,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;CACF;AAjBD,wDAiBC"}

View File

@@ -0,0 +1,38 @@
import type { IFileSystemSyncAccessHandle, FileSystemReadWriteOptions, CoreFsaContext } from './types';
import type { Superblock } from '@jsonjoy.com/fs-core';
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle
*/
export declare class CoreFileSystemSyncAccessHandle implements IFileSystemSyncAccessHandle {
private readonly _core;
private readonly _path;
private readonly _ctx;
private _fd;
private _closed;
constructor(_core: Superblock, _path: string, _ctx: CoreFsaContext);
private _ensureOpen;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/close
*/
close(): Promise<void>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/flush
*/
flush(): Promise<void>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/getSize
*/
getSize(): Promise<number>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read
*/
read(buffer: ArrayBuffer | ArrayBufferView, options?: FileSystemReadWriteOptions): Promise<number>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/truncate
*/
truncate(newSize: number): Promise<void>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write
*/
write(buffer: ArrayBuffer | ArrayBufferView | DataView, options?: FileSystemReadWriteOptions): Promise<number>;
}

View File

@@ -0,0 +1,123 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileSystemSyncAccessHandle = void 0;
const buffer_1 = require("@jsonjoy.com/fs-node-builtins/lib/internal/buffer");
const util_1 = require("./util");
const fs_node_utils_1 = require("@jsonjoy.com/fs-node-utils");
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle
*/
class CoreFileSystemSyncAccessHandle {
constructor(_core, _path, _ctx) {
this._core = _core;
this._path = _path;
this._ctx = _ctx;
this._fd = null;
this._closed = false;
this._ctx.locks.acquireLock(this._path);
}
_ensureOpen() {
if (this._closed) {
throw new DOMException('The file handle is closed.', 'InvalidStateError');
}
if (this._fd === null) {
// Open file for read/write
const flags = this._ctx.mode === 'readwrite' ? fs_node_utils_1.FLAGS['r+'] : fs_node_utils_1.FLAGS.r;
this._fd = this._core.open(this._path, flags, 0o644);
}
return this._fd;
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/close
*/
async close() {
if (this._fd !== null) {
this._core.close(this._fd);
this._fd = null;
}
this._closed = true;
this._ctx.locks.releaseLock(this._path);
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/flush
*/
async flush() {
const fd = this._ensureOpen();
// Core doesn't have an explicit flush method, but we can try to sync if available
// For now, this is a no-op as the core writes are synchronous
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/getSize
*/
async getSize() {
try {
const link = this._core.getResolvedLinkOrThrow(this._path);
const node = link.getNode();
return node.getSize();
}
catch (error) {
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/read
*/
async read(buffer, options = {}) {
const fd = this._ensureOpen();
const { at: position = 0 } = options;
const buf = buffer_1.Buffer.from(buffer);
try {
return this._core.read(fd, buf, 0, buf.length, position);
}
catch (error) {
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/truncate
*/
async truncate(newSize) {
if (this._ctx.mode !== 'readwrite') {
throw (0, util_1.newNotAllowedError)();
}
try {
const link = this._core.getResolvedLinkOrThrow(this._path);
const node = link.getNode();
node.truncate(newSize);
}
catch (error) {
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemSyncAccessHandle/write
*/
async write(buffer, options = {}) {
if (this._ctx.mode !== 'readwrite') {
throw (0, util_1.newNotAllowedError)();
}
const fd = this._ensureOpen();
const { at: position = 0 } = options;
const buf = buffer_1.Buffer.from(buffer);
try {
return this._core.write(fd, buf, 0, buf.length, position);
}
catch (error) {
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
}
}
exports.CoreFileSystemSyncAccessHandle = CoreFileSystemSyncAccessHandle;
//# sourceMappingURL=CoreFileSystemSyncAccessHandle.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CoreFileSystemSyncAccessHandle.js","sourceRoot":"","sources":["../src/CoreFileSystemSyncAccessHandle.ts"],"names":[],"mappings":";;;AAGA,8EAA2E;AAC3E,iCAA4C;AAC5C,8DAAmD;AAEnD;;GAEG;AACH,MAAa,8BAA8B;IAIzC,YACmB,KAAiB,EACjB,KAAa,EACb,IAAoB;QAFpB,UAAK,GAAL,KAAK,CAAY;QACjB,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAgB;QAN/B,QAAG,GAAkB,IAAI,CAAC;QAC1B,YAAO,GAAG,KAAK,CAAC;QAOtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAEO,WAAW;QACjB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,IAAI,YAAY,CAAC,4BAA4B,EAAE,mBAAmB,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC;YACtB,2BAA2B;YAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,qBAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qBAAK,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,IAAI,CAAC,GAAG,CAAC;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,CAAC;QAC9B,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,OAAO,CAAC;QAErC,MAAM,GAAG,GAAG,eAAM,CAAC,IAAI,CAAC,MAAoB,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAC5D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,qCAAsB,EAAE,CAAC;gBAC3E,MAAM,IAAA,yBAAkB,GAAE,CAAC;YAC7B,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AA3HD,wEA2HC"}

View File

@@ -0,0 +1,32 @@
import type { IFileSystemWritableFileStream, FileSystemWritableFileStreamParams, Data, CoreFsaContext } from './types';
import type { Superblock } from '@jsonjoy.com/fs-core';
declare const WS: typeof WritableStream;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
*/
export declare class CoreFileSystemWritableFileStream extends WS implements IFileSystemWritableFileStream {
private _fd;
private _position;
private _closed;
private readonly _core;
private readonly _path;
private readonly _ctx;
constructor(core: Superblock, path: string, keepExistingData: boolean | undefined, ctx: CoreFsaContext);
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek
*/
seek(position: number): Promise<void>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate
*/
truncate(size: number): Promise<void>;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write
*/
write(chunk: Data): Promise<void>;
write(params: FileSystemWritableFileStreamParams): Promise<void>;
private _write;
private _isParams;
private _dataToBuffer;
}
export {};

View File

@@ -0,0 +1,163 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoreFileSystemWritableFileStream = void 0;
const buffer_1 = require("@jsonjoy.com/fs-node-builtins/lib/internal/buffer");
const util_1 = require("./util");
const fs_node_utils_1 = require("@jsonjoy.com/fs-node-utils");
const WS = (typeof WritableStream === 'undefined' ? require('stream/web').WritableStream : WritableStream);
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
*/
class CoreFileSystemWritableFileStream extends WS {
constructor(core, path, keepExistingData = false, ctx) {
let fd;
super({
start: controller => {
if (ctx.locks.isLocked(path)) {
throw (0, util_1.newNoModificationAllowedError)();
}
ctx.locks.acquireLock(path);
const flags = keepExistingData ? fs_node_utils_1.FLAGS['r+'] : fs_node_utils_1.FLAGS.w;
try {
fd = core.open(path, flags, 438 /* MODE.FILE */);
}
catch (error) {
ctx.locks.releaseLock(path);
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
},
write: async (chunk) => {
await this._write(chunk);
},
close: async () => {
if (!this._closed && this._fd !== undefined) {
core.close(this._fd);
this._closed = true;
ctx.locks.releaseLock(path);
}
},
abort: async () => {
if (!this._closed && this._fd !== undefined) {
core.close(this._fd);
this._closed = true;
ctx.locks.releaseLock(path);
}
},
});
this._position = 0;
this._closed = false;
this._core = core;
this._path = path;
this._fd = fd;
this._ctx = ctx;
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek
*/
async seek(position) {
if (this._closed) {
throw new DOMException('The stream is closed.', 'InvalidStateError');
}
this._position = position;
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate
*/
async truncate(size) {
if (this._closed) {
throw new DOMException('The stream is closed.', 'InvalidStateError');
}
try {
const link = this._core.getResolvedLinkOrThrow(this._path);
const node = link.getNode();
node.truncate(size);
}
catch (error) {
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
}
async write(chunkOrParams) {
await this._write(chunkOrParams);
}
async _write(chunkOrParams) {
if (this._closed) {
throw new DOMException('The stream is closed.', 'InvalidStateError');
}
if (this._fd === undefined) {
throw new DOMException('The stream is not ready.', 'InvalidStateError');
}
try {
if (this._isParams(chunkOrParams)) {
const params = chunkOrParams;
switch (params.type) {
case 'write': {
if (params.data !== undefined) {
const buffer = this._dataToBuffer(params.data);
const position = params.position !== undefined ? params.position : this._position;
const written = this._core.write(this._fd, buffer, 0, buffer.length, position);
if (params.position === undefined) {
this._position += written;
}
}
break;
}
case 'seek': {
if (params.position !== undefined) {
this._position = params.position;
}
break;
}
case 'truncate': {
if (params.size !== undefined) {
await this.truncate(params.size);
}
break;
}
}
}
else {
// Direct data write
const buffer = this._dataToBuffer(chunkOrParams);
const written = this._core.write(this._fd, buffer, 0, buffer.length, this._position);
this._position += written;
}
}
catch (error) {
if (error && typeof error === 'object' && error.code === "EACCES" /* ERROR_CODE.EACCES */) {
throw (0, util_1.newNotAllowedError)();
}
throw error;
}
}
_isParams(chunk) {
return !!(chunk && typeof chunk === 'object' && 'type' in chunk);
}
_dataToBuffer(data) {
if (typeof data === 'string') {
return buffer_1.Buffer.from(data, 'utf8');
}
if (data instanceof buffer_1.Buffer) {
return data;
}
if (data instanceof ArrayBuffer) {
return buffer_1.Buffer.from(data);
}
if (ArrayBuffer.isView(data)) {
return buffer_1.Buffer.from(data.buffer, data.byteOffset, data.byteLength);
}
if (data instanceof Blob) {
// For Blob, we would need to read it asynchronously
// This is a simplified implementation
throw new Error('Blob data type not fully supported in this implementation');
}
throw new Error('Unsupported data type');
}
}
exports.CoreFileSystemWritableFileStream = CoreFileSystemWritableFileStream;
//# sourceMappingURL=CoreFileSystemWritableFileStream.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,9 @@
import type { IPermissionStatus } from './types';
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus
*/
export declare class CorePermissionStatus implements IPermissionStatus {
readonly name: string;
readonly state: 'granted' | 'denied' | 'prompt';
constructor(state: 'granted' | 'denied' | 'prompt', name?: string);
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CorePermissionStatus = void 0;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus
*/
class CorePermissionStatus {
constructor(state, name = '') {
this.name = name;
this.state = state;
}
}
exports.CorePermissionStatus = CorePermissionStatus;
//# sourceMappingURL=CorePermissionStatus.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"CorePermissionStatus.js","sourceRoot":"","sources":["../src/CorePermissionStatus.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,oBAAoB;IAI/B,YAAY,KAAsC,EAAE,OAAe,EAAE;QACnE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AARD,oDAQC"}

View File

@@ -0,0 +1,7 @@
export declare class FileLockManager {
private locks;
acquireLock(path: string): boolean;
releaseLock(path: string): void;
isLocked(path: string): boolean;
clear(): void;
}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileLockManager = void 0;
class FileLockManager {
constructor() {
this.locks = new Map();
}
acquireLock(path) {
if (this.locks.get(path)) {
return false;
}
this.locks.set(path, true);
return true;
}
releaseLock(path) {
this.locks.delete(path);
}
isLocked(path) {
return this.locks.get(path) ?? false;
}
clear() {
this.locks.clear();
}
}
exports.FileLockManager = FileLockManager;
//# sourceMappingURL=FileLockManager.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"FileLockManager.js","sourceRoot":"","sources":["../src/FileLockManager.ts"],"names":[],"mappings":";;;AAAA,MAAa,eAAe;IAA5B;QACU,UAAK,GAAyB,IAAI,GAAG,EAAE,CAAC;IAqBlD,CAAC;IAnBQ,WAAW,CAAC,IAAY;QAC7B,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,WAAW,CAAC,IAAY;QAC7B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAEM,QAAQ,CAAC,IAAY;QAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;IACvC,CAAC;IAEM,KAAK;QACV,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;CACF;AAtBD,0CAsBC"}

33
node_modules/@jsonjoy.com/fs-fsa/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
import { CoreFileSystemDirectoryHandle } from './CoreFileSystemDirectoryHandle';
import { CoreFsaContext, IFileSystemObserverConstructable } from './types';
import { Superblock } from '@jsonjoy.com/fs-core';
export * from './types';
export * from './CoreFileSystemHandle';
export * from './CoreFileSystemDirectoryHandle';
export * from './CoreFileSystemFileHandle';
export * from './CoreFileSystemSyncAccessHandle';
export * from './CoreFileSystemWritableFileStream';
export * from './CoreFileSystemObserver';
export * from './CorePermissionStatus';
export * from './FileLockManager';
/**
* Create a new instance of an in-memory File System Access API
* implementation rooted at the root directory of the filesystem.
*
* @param ctx Optional context for the File System Access API.
* @param core Optional low-level file system implementation to
* back the File System Access API. If not provided, a new empty
* Superblock instance will be created.
* @param dirPath Optional path within the filesystem to use as the root
* directory of the File System Access API. Defaults to `/`.
* @returns A File System Access API implementation `dir` rooted at
* the root directory of the filesystem, as well as the `core`,
* a low-level file system implementation itself. Also, returns
* `FileSystemObserver`, a class that can be used to create
* observers that watch for changes to files and directories.
*/
export declare const fsa: (ctx?: Partial<CoreFsaContext>, core?: Superblock, dirPath?: string) => {
core: Superblock;
dir: CoreFileSystemDirectoryHandle;
FileSystemObserver: IFileSystemObserverConstructable;
};

43
node_modules/@jsonjoy.com/fs-fsa/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fsa = void 0;
const tslib_1 = require("tslib");
const CoreFileSystemDirectoryHandle_1 = require("./CoreFileSystemDirectoryHandle");
const fs_core_1 = require("@jsonjoy.com/fs-core");
const CoreFileSystemObserver_1 = require("./CoreFileSystemObserver");
tslib_1.__exportStar(require("./types"), exports);
tslib_1.__exportStar(require("./CoreFileSystemHandle"), exports);
tslib_1.__exportStar(require("./CoreFileSystemDirectoryHandle"), exports);
tslib_1.__exportStar(require("./CoreFileSystemFileHandle"), exports);
tslib_1.__exportStar(require("./CoreFileSystemSyncAccessHandle"), exports);
tslib_1.__exportStar(require("./CoreFileSystemWritableFileStream"), exports);
tslib_1.__exportStar(require("./CoreFileSystemObserver"), exports);
tslib_1.__exportStar(require("./CorePermissionStatus"), exports);
tslib_1.__exportStar(require("./FileLockManager"), exports);
/**
* Create a new instance of an in-memory File System Access API
* implementation rooted at the root directory of the filesystem.
*
* @param ctx Optional context for the File System Access API.
* @param core Optional low-level file system implementation to
* back the File System Access API. If not provided, a new empty
* Superblock instance will be created.
* @param dirPath Optional path within the filesystem to use as the root
* directory of the File System Access API. Defaults to `/`.
* @returns A File System Access API implementation `dir` rooted at
* the root directory of the filesystem, as well as the `core`,
* a low-level file system implementation itself. Also, returns
* `FileSystemObserver`, a class that can be used to create
* observers that watch for changes to files and directories.
*/
const fsa = (ctx, core = new fs_core_1.Superblock(), dirPath = '/') => {
const dir = new CoreFileSystemDirectoryHandle_1.CoreFileSystemDirectoryHandle(core, dirPath, ctx);
const FileSystemObserver = class FileSystemObserver extends CoreFileSystemObserver_1.CoreFileSystemObserver {
constructor(callback) {
super(core, callback);
}
};
return { core, dir, FileSystemObserver };
};
exports.fsa = fsa;
//# sourceMappingURL=index.js.map

1
node_modules/@jsonjoy.com/fs-fsa/lib/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,mFAAgF;AAOhF,kDAAkD;AAClD,qEAAkE;AAElE,kDAAwB;AACxB,iEAAuC;AACvC,0EAAgD;AAChD,qEAA2C;AAC3C,2EAAiD;AACjD,6EAAmD;AACnD,mEAAyC;AACzC,iEAAuC;AACvC,4DAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AACI,MAAM,GAAG,GAAG,CAAC,GAA6B,EAAE,IAAI,GAAG,IAAI,oBAAU,EAAE,EAAE,UAAkB,GAAG,EAAE,EAAE;IACnG,MAAM,GAAG,GAAG,IAAI,6DAA6B,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC;IAClE,MAAM,kBAAkB,GAAqC,MAAM,kBAAmB,SAAQ,+CAAsB;QAClH,YAAY,QAAqF;YAC/F,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACxB,CAAC;KACF,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC;AAC3C,CAAC,CAAC;AARW,QAAA,GAAG,OAQd"}

182
node_modules/@jsonjoy.com/fs-fsa/lib/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,182 @@
import type { FileLockManager } from './FileLockManager';
export interface IPermissionStatus {
name: string;
state: 'granted' | 'denied' | 'prompt';
}
export interface IFileSystemHandle {
kind: 'file' | 'directory';
name: string;
isSameEntry(fileSystemHandle: IFileSystemHandle): boolean;
queryPermission(fileSystemHandlePermissionDescriptor: FileSystemHandlePermissionDescriptor): Promise<IPermissionStatus>;
remove(options?: {
recursive?: boolean;
}): Promise<void>;
requestPermission(fileSystemHandlePermissionDescriptor: FileSystemHandlePermissionDescriptor): IPermissionStatus;
}
export interface FileSystemHandlePermissionDescriptor {
mode: 'read' | 'readwrite';
}
export interface IFileSystemDirectoryHandle extends IFileSystemHandle {
keys(): AsyncIterableIterator<string>;
entries(): AsyncIterableIterator<[string, IFileSystemHandle]>;
values(): AsyncIterableIterator<IFileSystemHandle>;
getDirectoryHandle(name: string, options?: GetDirectoryHandleOptions): Promise<IFileSystemDirectoryHandle>;
getFileHandle(name: string, options?: GetFileHandleOptions): Promise<IFileSystemFileHandle>;
removeEntry(name: string, options?: RemoveEntryOptions): Promise<void>;
resolve(possibleDescendant: IFileSystemHandle): Promise<string[] | null>;
}
/**
* Context for Core FSA operations - similar to NodeFsaContext but for Superblock
*/
export interface CoreFsaContext {
separator: '/' | '\\';
/** Whether synchronous file handles are allowed. */
syncHandleAllowed: boolean;
/** Whether writes are allowed, defaults to `read`. */
mode: 'read' | 'readwrite';
/** File lock manager for this context. */
locks: FileLockManager;
}
export interface CreateWritableOptions {
keepExistingData?: boolean;
}
export interface GetDirectoryHandleOptions {
/**
* A boolean value, which defaults to `false`. When set to `true` if the directory
* is not found, one with the specified name will be created and returned.
*/
create?: boolean;
}
export interface GetFileHandleOptions {
/**
* A Boolean. Default `false`. When set to `true` if the file is not found,
* one with the specified name will be created and returned.
*/
create?: boolean;
}
export interface RemoveEntryOptions {
/**
* A boolean value, which defaults to `false`. When set to true entries will
* be removed recursively.
*/
recursive?: boolean;
}
export interface IFileSystemFileHandle extends IFileSystemHandle {
getFile(): Promise<File>;
createSyncAccessHandle: undefined | (() => Promise<IFileSystemSyncAccessHandle>);
createWritable(options?: CreateWritableOptions): Promise<IFileSystemWritableFileStream>;
}
export interface CreateWritableOptions {
keepExistingData?: boolean;
}
export interface IFileSystemSyncAccessHandle {
close(): Promise<void>;
flush(): Promise<void>;
getSize(): Promise<number>;
read(buffer: ArrayBuffer | ArrayBufferView, options?: FileSystemReadWriteOptions): Promise<number>;
truncate(newSize: number): Promise<void>;
write(buffer: ArrayBuffer | ArrayBufferView | DataView, options?: FileSystemReadWriteOptions): Promise<number>;
}
export interface FileSystemReadWriteOptions {
/**
* A number representing the offset in bytes that the file should be read from.
*/
at?: number;
}
export interface IFileSystemWritableFileStream extends WritableStream {
seek(position: number): Promise<void>;
truncate(size: number): Promise<void>;
write(chunk: Data): Promise<void>;
write(params: FileSystemWritableFileStreamParams): Promise<void>;
}
export interface FileSystemWritableFileStreamParams {
type: 'write' | 'truncate' | 'seek';
data?: Data;
position?: number;
size?: number;
}
export type Data = ArrayBuffer | ArrayBufferView | Uint8Array | Uint8ClampedArray | Int8Array | Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array | Float64Array | BigUint64Array | BigInt64Array | DataView | Blob | string;
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemChangeRecord
*/
export interface IFileSystemChangeRecord {
/**
* A reference to the file system handle that the change was observed on. This
* property will be null for records with a "disappeared", "errored", or
* "unknown" type.
*/
changedHandle: IFileSystemHandle | IFileSystemSyncAccessHandle | IFileSystemDirectoryHandle | null;
/**
* An array containing the path components that make up the relative file path
* from the `root` to the `changedHandle`, including the `changedHandle`
* filename.
*/
relativePathComponents: string[];
/**
* An array containing the path components that make up the relative file path
* from the `root` to the `changedHandle`'s former location, in the case of
* observations with a `"moved"` type. If the type is not `"moved"`, this
* property will be `null`.
*/
relativePathMovedFrom: string[] | null;
/**
* A reference to the root file system handle, that is, the one passed to the
* `observe()` call that started the observation.
*/
root: IFileSystemHandle | IFileSystemSyncAccessHandle | IFileSystemDirectoryHandle;
/**
* The type of change that occurred.
*/
type: 'appeared'
/**
* The file or directory was deleted or moved out of the root file structure.
* To find out which file or directory `disappeared`, you can query the
* `relativePathComponents` property.
*/
| 'disappeared'
/** An error state occurred in the observed directory. */
| 'errored'
/** The file or directory was modified. */
| 'modified'
/**
* The file or directory was moved within the root file structure.
*
* Chrome note: On Windows, "moved" observations aren't supported between
* directories. They are reported as a "disappeared" observation in the
* source directory and an "appeared" observation in the destination directory.
*/
| 'moved'
/**
* Indicates that some observations were missed. If you wish to find out
* information on what changed in the missed observations, you could fall
* back to polling the observed directory.
*/
| 'unknown';
}
export interface IFileSystemObserverObserveOptions {
/** Whether to observe changes recursively in subdirectories. */
recursive?: boolean;
}
/**
* @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemObserver
*/
export interface IFileSystemObserver {
/**
* Start observing changes to a given file or directory.
*
* @param handle The file or directory handle to observe.
* @param options Optional settings for the observation.
*/
observe(handle: IFileSystemFileHandle | IFileSystemDirectoryHandle | IFileSystemSyncAccessHandle, options?: IFileSystemObserverObserveOptions): Promise<void>;
/** Disconnect and stop all observations. */
disconnect(): void;
}
export interface IFileSystemObserverConstructable {
/**
* Constructor for creating a FileSystemObserver.
*
* @param callback Function called with file system change records and the
* observer instance
*/
new (callback: (records: IFileSystemChangeRecord[], observer: IFileSystemObserver) => void): IFileSystemObserver;
}

3
node_modules/@jsonjoy.com/fs-fsa/lib/types.js generated vendored Normal file
View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map

1
node_modules/@jsonjoy.com/fs-fsa/lib/types.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}

12
node_modules/@jsonjoy.com/fs-fsa/lib/util.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import type { CoreFsaContext } from './types';
/**
* Creates a new {@link CoreFsaContext}.
*/
export declare const ctx: (partial?: Partial<CoreFsaContext>) => CoreFsaContext;
export declare const basename: (path: string, separator: string) => string;
export declare const assertName: (name: string, method: string, klass: string) => void;
export declare const assertCanWrite: (mode: "read" | "readwrite") => void;
export declare const newNotFoundError: () => DOMException;
export declare const newTypeMismatchError: () => DOMException;
export declare const newNotAllowedError: () => DOMException;
export declare const newNoModificationAllowedError: () => DOMException;

45
node_modules/@jsonjoy.com/fs-fsa/lib/util.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.newNoModificationAllowedError = exports.newNotAllowedError = exports.newTypeMismatchError = exports.newNotFoundError = exports.assertCanWrite = exports.assertName = exports.basename = exports.ctx = void 0;
const FileLockManager_1 = require("./FileLockManager");
/**
* Creates a new {@link CoreFsaContext}.
*/
const ctx = (partial = {}) => {
return {
separator: '/',
syncHandleAllowed: false,
mode: 'read',
locks: new FileLockManager_1.FileLockManager(),
...partial,
};
};
exports.ctx = ctx;
const basename = (path, separator) => {
if (path[path.length - 1] === separator)
path = path.slice(0, -1);
const lastSlashIndex = path.lastIndexOf(separator);
return lastSlashIndex === -1 ? path : path.slice(lastSlashIndex + 1);
};
exports.basename = basename;
const nameRegex = /^(\.{1,2})$|[\/\\]/;
const assertName = (name, method, klass) => {
const isInvalid = !name || nameRegex.test(name);
if (isInvalid)
throw new TypeError(`Failed to execute '${method}' on '${klass}': Name is not allowed.`);
};
exports.assertName = assertName;
const assertCanWrite = (mode) => {
if (mode !== 'readwrite')
throw new DOMException('The request is not allowed by the user agent or the platform in the current context.', 'NotAllowedError');
};
exports.assertCanWrite = assertCanWrite;
const newNotFoundError = () => new DOMException('A requested file or directory could not be found at the time an operation was processed.', 'NotFoundError');
exports.newNotFoundError = newNotFoundError;
const newTypeMismatchError = () => new DOMException('The path supplied exists, but was not an entry of requested type.', 'TypeMismatchError');
exports.newTypeMismatchError = newTypeMismatchError;
const newNotAllowedError = () => new DOMException('Permission not granted.', 'NotAllowedError');
exports.newNotAllowedError = newNotAllowedError;
const newNoModificationAllowedError = () => new DOMException('The file is locked and cannot be modified.', 'NoModificationAllowedError');
exports.newNoModificationAllowedError = newNoModificationAllowedError;
//# sourceMappingURL=util.js.map

1
node_modules/@jsonjoy.com/fs-fsa/lib/util.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAAA,uDAAoD;AAGpD;;GAEG;AACI,MAAM,GAAG,GAAG,CAAC,UAAmC,EAAE,E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