mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-22 16:29:10 +02:00
Adicionado mais algumas classes de controle de arquivos.
This commit is contained in:
parent
e61df9571c
commit
8eb6e78e43
@ -42,7 +42,11 @@ Type
|
|||||||
TJSUIEvent = class;
|
TJSUIEvent = class;
|
||||||
TJSTouchEvent = Class;
|
TJSTouchEvent = Class;
|
||||||
TJSBlob = class;
|
TJSBlob = class;
|
||||||
|
TJSPermissions = class;
|
||||||
|
TJSFileSystemFileHandle = class;
|
||||||
|
TJSFileSystemDirectoryHandle = class;
|
||||||
|
TJSShowOpenFilePickerOptions = class;
|
||||||
|
TJSShowSaveFilePickerOptions = class;
|
||||||
|
|
||||||
{ TEventListenerEvent }
|
{ TEventListenerEvent }
|
||||||
|
|
||||||
@ -1812,6 +1816,7 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
FServiceWorker: TJSServiceWorkerContainer; external name 'serviceWorker';
|
FServiceWorker: TJSServiceWorkerContainer; external name 'serviceWorker';
|
||||||
FUserAgent: string; external name 'userAgent';
|
FUserAgent: string; external name 'userAgent';
|
||||||
fClipBoard : TJSClipBoard; external name 'clipboard';
|
fClipBoard : TJSClipBoard; external name 'clipboard';
|
||||||
|
FPermissions: TJSPermissions; external name 'permissions';
|
||||||
public
|
public
|
||||||
function getBattery : TJSPromise;
|
function getBattery : TJSPromise;
|
||||||
function requestMediaKeySystemAccess(aKeySystem : String; supportedConfigurations : TJSValueDynArray) : TJSPromise;
|
function requestMediaKeySystemAccess(aKeySystem : String; supportedConfigurations : TJSValueDynArray) : TJSPromise;
|
||||||
@ -1835,6 +1840,7 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
property userAgent : string read FUserAgent;
|
property userAgent : string read FUserAgent;
|
||||||
property serviceWorker : TJSServiceWorkerContainer read FServiceWorker;
|
property serviceWorker : TJSServiceWorkerContainer read FServiceWorker;
|
||||||
property ClipBoard : TJSClipBoard Read FCLipboard;
|
property ClipBoard : TJSClipBoard Read FCLipboard;
|
||||||
|
property permissions: TJSPermissions read FPermissions;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TJSTouchEvent }
|
{ TJSTouchEvent }
|
||||||
@ -1984,6 +1990,16 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
function tee(): TJSArray; // array containing two TJSReadableStream instances
|
function tee(): TJSArray; // array containing two TJSReadableStream instances
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TJSWritableStream = class external name 'WritableStream' (TJSObject)
|
||||||
|
private
|
||||||
|
FLocked: Boolean; external name 'locked';
|
||||||
|
public
|
||||||
|
function abort(reason: String): TJSPromise;
|
||||||
|
function close: TJSPromise;
|
||||||
|
function getWriter: TJSObject;
|
||||||
|
property locked: Boolean read FLocked;
|
||||||
|
end;
|
||||||
|
|
||||||
TJSBody = class external name 'Body' (TJSObject)
|
TJSBody = class external name 'Body' (TJSObject)
|
||||||
private
|
private
|
||||||
fbody: TJSReadableStream; external name 'body';
|
fbody: TJSReadableStream; external name 'body';
|
||||||
@ -2204,6 +2220,11 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
procedure cancelIdleCallback(handle: NativeInt);
|
procedure cancelIdleCallback(handle: NativeInt);
|
||||||
function requestIdleCallback(handler: TIdleCallbackProc): NativeInt; overload;
|
function requestIdleCallback(handler: TIdleCallbackProc): NativeInt; overload;
|
||||||
function requestIdleCallback(handler: TIdleCallbackProc; options: TJSIdleCallbackOptions): NativeInt; overload;
|
function requestIdleCallback(handler: TIdleCallbackProc; options: TJSIdleCallbackOptions): NativeInt; overload;
|
||||||
|
function showOpenFilePicker: array of TJSFileSystemFileHandle; async; overload;
|
||||||
|
function showOpenFilePicker(options: TJSShowOpenFilePickerOptions): array of TJSFileSystemFileHandle; async; overload;
|
||||||
|
function showSaveFilePicker: TJSFileSystemFileHandle; async; overload;
|
||||||
|
function showSaveFilePicker(options: TJSShowSaveFilePickerOptions): TJSFileSystemFileHandle; async; overload;
|
||||||
|
function FileSystemDirectoryHandle: array of TJSFileSystemDirectoryHandle; async;
|
||||||
{ public properties }
|
{ public properties }
|
||||||
property console : TJSConsole Read FConsole;
|
property console : TJSConsole Read FConsole;
|
||||||
property closed : boolean read FClosed;
|
property closed : boolean read FClosed;
|
||||||
@ -2458,10 +2479,10 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
function slice(aStart,aEnd : NativeInt; AContentType : String) : TJSBlob; overload;
|
function slice(aStart,aEnd : NativeInt; AContentType : String) : TJSBlob; overload;
|
||||||
function arrayBuffer : TJSPromise;
|
function arrayBuffer : TJSPromise;
|
||||||
property size : NativeInt read FSize;
|
property size : NativeInt read FSize;
|
||||||
property _type : string read FType;
|
property _type : string read FType; deprecated;
|
||||||
|
property &type : string read FType;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ TJSHTMLFile }
|
{ TJSHTMLFile }
|
||||||
|
|
||||||
TJSHTMLFile = class external name 'File' (TJSBlob)
|
TJSHTMLFile = class external name 'File' (TJSBlob)
|
||||||
@ -2469,10 +2490,10 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
FLastModified: NativeInt; external name 'lastModified';
|
FLastModified: NativeInt; external name 'lastModified';
|
||||||
FLastModifiedDate: TJSDate; external name 'lastModifiedDate';
|
FLastModifiedDate: TJSDate; external name 'lastModifiedDate';
|
||||||
FName: string; external name 'name';
|
FName: string; external name 'name';
|
||||||
Public
|
public
|
||||||
property name : string read FName;
|
property lastModified: NativeInt read FLastModified;
|
||||||
property lastModified : NativeInt read FLastModified;
|
property lastModifiedDate : TJSDate read FLastModifiedDate; deprecated;
|
||||||
property lastModifiedDate : TJSDate read FLastModifiedDate;
|
property name: String read FName;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TJSHTMLFileList }
|
{ TJSHTMLFileList }
|
||||||
@ -3843,6 +3864,117 @@ TEventListenerEvent = class external name 'EventListener_Event' (TJSObject)
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
TOnChangeProcedure = reference to procedure;
|
||||||
|
|
||||||
|
TJSPermissionDescriptor = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
name: String;
|
||||||
|
userVisibleOnly: Boolean;
|
||||||
|
sysex: Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSPermissionStatus = class external name 'PermissionStatus' (TJSObject)
|
||||||
|
private
|
||||||
|
FState: String; external name 'state';
|
||||||
|
public
|
||||||
|
onchange: TOnChangeProcedure;
|
||||||
|
property state: String read FState;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSPermissions = class external name 'Permissions' (TJSObject)
|
||||||
|
public
|
||||||
|
function query(descriptor: TJSPermissionDescriptor): TJSPermissionStatus; async;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSFileSystemHandlePermissionDescriptor = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
mode: String;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSFileSystemCreateWritableOptions = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
keepExistingData: Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSFileSystemWritableFileStream = class;
|
||||||
|
|
||||||
|
TJSFileSystemHandle = class external name 'FileSystemHandle' (TJSObject)
|
||||||
|
private
|
||||||
|
FKind: String; external name 'kind';
|
||||||
|
FName: String; external name 'name';
|
||||||
|
public
|
||||||
|
function isSameEntry(const Handle: TJSFileSystemHandle): Boolean;
|
||||||
|
function queryPermission(descriptor: TJSFileSystemHandlePermissionDescriptor): String;
|
||||||
|
function requestPermission(descriptor: TJSFileSystemHandlePermissionDescriptor): String;
|
||||||
|
|
||||||
|
property kind: String read FKind;
|
||||||
|
property name: String read FName;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSFileSystemFileHandle = class external name 'FileSystemFileHandle' (TJSFileSystemHandle)
|
||||||
|
public
|
||||||
|
function getFile: TJSHTMLFile; async;
|
||||||
|
function createWritable: TJSFileSystemWritableFileStream; overload;
|
||||||
|
function createWritable(options: TJSFileSystemCreateWritableOptions): TJSFileSystemWritableFileStream; overload;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSGetFileHandleOptions = class external name 'Object'
|
||||||
|
public
|
||||||
|
create: Boolean;
|
||||||
|
|
||||||
|
constructor new;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSRemoveEntryOptions = class external name 'Object' (TJSObject)
|
||||||
|
recursive: Boolean;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSFileSystemDirectoryHandle = class external name 'FileSystemDirectoryHandle' (TJSFileSystemHandle)
|
||||||
|
public
|
||||||
|
function entries: TJSObject;
|
||||||
|
function getDirectoryHandle(name: String): TJSFileSystemDirectoryHandle; async; overload;
|
||||||
|
function getDirectoryHandle(name: String; options: TJSGetFileHandleOptions): TJSFileSystemDirectoryHandle; async; overload;
|
||||||
|
function getFileHandle(name: String): TJSFileSystemFileHandle; async; overload;
|
||||||
|
function getFileHandle(name: String; options: TJSGetFileHandleOptions): TJSFileSystemFileHandle; async; overload;
|
||||||
|
function keys: array of TJSFileSystemDirectoryHandle;
|
||||||
|
function removeEntry(name: String): TJSPromise;
|
||||||
|
function removeEntry(name: String; options: TJSRemoveEntryOptions): TJSPromise;
|
||||||
|
function resolve(possibleDescendant: String): array of String; async;
|
||||||
|
function values(possibleDescendant: String): array of TJSFileSystemDirectoryHandle; async;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSFileSystemWritableFileStream = class external name 'FileSystemWritableFileStream' (TJSWritableStream)
|
||||||
|
public
|
||||||
|
function seek(position: NativeInt): TJSPromise;
|
||||||
|
function write(data: JSValue): TJSPromise;
|
||||||
|
function truncate(size: NativeInt): TJSPromise;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSShowOpenFilePickerTypeOptions = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
description: String;
|
||||||
|
accept: TJSObject;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSShowOpenFilePickerOptions = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
multiple: Boolean;
|
||||||
|
excludeAcceptAllOption: Boolean;
|
||||||
|
types: array of TJSShowOpenFilePickerTypeOptions;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSShowSaveFilePickerOptionsAccept = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
description: String;
|
||||||
|
accept: array of String;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSShowSaveFilePickerOptions = class external name 'Object' (TJSObject)
|
||||||
|
public
|
||||||
|
excludeAcceptAllOption: Boolean;
|
||||||
|
accept: array of TJSShowSaveFilePickerOptionsAccept;
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
document : TJSDocument; external name 'document';
|
document : TJSDocument; external name 'document';
|
||||||
window : TJSWindow; external name 'window';
|
window : TJSWindow; external name 'window';
|
||||||
|
Loading…
Reference in New Issue
Block a user