/** * Common functions between client and server * * Copyright 2013-2024 bluefox * * MIT License * */ import * as CONSTS from '../../lib/objects/constants.js'; export * as CONSTS from '../../lib/objects/constants.js'; export declare const ERRORS: typeof CONSTS.ERRORS; export declare const REG_CHECK_ID: RegExp; export interface FileMimeInformation { /** the mime type, of the file */ mimeType: string; /** if content is binary or textual */ isBinary: boolean; } export interface ACLObject { owner: string; ownerGroup: string; object: number; state: number; file: number; } export interface FileObject { virtualFile?: boolean; stats: any; modifiedAt: number; createdAt: number; acl: ioBroker.EvaluatedFileACL; } export type CheckFileRightsCallback = (err: Error | null | undefined, options: Record, opt?: any) => void; /** * Determines the mime type, of an extension and if it is binary content * * @param ext file extension e.g. `.txt` * @param isTextData if content is of type string */ export declare function getMimeType(ext: string, isTextData: boolean): FileMimeInformation; export declare function checkFile(fileOptions: Record, options: Record, flag: any, defaultNewAcl?: ACLObject | null): boolean; export declare function checkFileRights(objects: any, id: string, name: string | null, options: Record | null | undefined, flag: CONSTS.GenericAccessFlags, callback?: CheckFileRightsCallback): any; export type GetUserGroupPromiseReturn = [user: string, groups: string[], acl: ioBroker.ObjectPermissions]; type GetUserGroupCallback = (err: Error | null | undefined, user: string, groups: string[], acl: ioBroker.ObjectPermissions) => void; export declare function getUserGroup(objects: any, user: ioBroker.ObjectIDs.User, callback?: GetUserGroupCallback): Promise | void; export declare function sanitizePath(id: string, name: string): { id: string; name: string; }; export declare function checkObject(obj: ioBroker.AnyObject | FileObject | null, options: Record, flag: CONSTS.GenericAccessFlags): boolean; export declare function checkObjectRights(objects: any, id: string | null, object: ioBroker.Object | null, options: Record | null | undefined, flag: CONSTS.GenericAccessFlags, callback: (err: Error | null | undefined, options: Record) => void): void | Promise>; //# sourceMappingURL=objectsUtils.d.ts.map