@zenfs/core
Version:
A filesystem, anywhere
48 lines (47 loc) • 1.66 kB
TypeScript
import { BufferView } from 'utilium/buffer';
import { type V_Context } from '../internal/contexts.js';
import { type InodeLike } from '../internal/inode.js';
export declare const enum Type {
Access = 32768,
Default = 16384
}
export declare const enum Tag {
UserObj = 1,
User = 2,
GroupObj = 4,
Group = 8,
Mask = 16,
Other = 32,
/**
* @internal @hidden
*/
_None = 0
}
declare const Entry_base: import("memium").StructConstructor<BufferView<any>>;
export declare class Entry extends Entry_base {
static name: string;
accessor tag: Tag;
accessor perm: number;
accessor id: number;
}
declare const ACL_base: import("memium").StructConstructor<BufferView<any>>;
export declare class ACL extends ACL_base {
static name: string;
accessor version: number;
entries: Entry[];
constructor(...args: ConstructorParameters<typeof BufferView>);
}
export declare function fromMode(mode: number): ACL;
export declare function toMode(acl: ACL): number;
export declare function get($: V_Context, path: string): Promise<ACL>;
export declare function getSync($: V_Context, path: string): ACL;
export declare function set($: V_Context, path: string, acl: ACL): Promise<void>;
export declare function setSync($: V_Context, path: string, acl: ACL): void;
export declare let shouldCheck: boolean;
export declare function setChecks(enabled: boolean): void;
/**
* Checks if a given user/group has access to this item
* @param access The requested access, combination of `W_OK`, `R_OK`, and `X_OK`
*/
export declare function check($: V_Context, inode: InodeLike, access: number): boolean;
export {};