mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-24 22:09:24 +02:00
* Added MutationObserver declaration
This commit is contained in:
parent
9636f88afa
commit
d963787f7f
@ -2793,6 +2793,47 @@ Type
|
|||||||
property shiftKey : Boolean read FShiftKey;
|
property shiftKey : Boolean read FShiftKey;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ MutationObserver }
|
||||||
|
|
||||||
|
TJSMutationObserver = Class;
|
||||||
|
|
||||||
|
TJSMutationRecord = record
|
||||||
|
type_ : string;
|
||||||
|
target : TJSNode;
|
||||||
|
addedNodes : TJSNodeList;
|
||||||
|
removedNodes : TJSNodeList;
|
||||||
|
previousSibling : TJSNode;
|
||||||
|
nextSibling : TJSNode;
|
||||||
|
attributeName : String;
|
||||||
|
attributeNamespace : String;
|
||||||
|
oldValue : String;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSMutationRecordArray = array of TJSMutationRecord;
|
||||||
|
TJSMutationCallback = reference to procedure(mutations: TJSMutationRecordArray; observer: TJSMutationObserver);
|
||||||
|
|
||||||
|
TJSMutationObserverInit = record
|
||||||
|
attributes: boolean;
|
||||||
|
attributeOldValue: boolean;
|
||||||
|
characterData: boolean;
|
||||||
|
characterDataOldValue: boolean;
|
||||||
|
childList: boolean;
|
||||||
|
subTree: boolean;
|
||||||
|
attributeFilter: TJSArray;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TJSMutationObserver = class external name 'MutationObserver' (TJSObject)
|
||||||
|
public
|
||||||
|
{ constructor }
|
||||||
|
constructor new(mutationCallback: TJSMutationCallback);
|
||||||
|
{ public methods }
|
||||||
|
procedure observe(target: TJSNode); overload;
|
||||||
|
procedure observe(target: TJSNode; options: TJSMutationObserverInit); overload;
|
||||||
|
procedure observe(target: TJSNode; options: TJSObject); overload;
|
||||||
|
procedure disconnect;
|
||||||
|
function takeRecords: TJSMutationRecordArray;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
document : TJSDocument; external name 'document';
|
document : TJSDocument; external name 'document';
|
||||||
|
Loading…
Reference in New Issue
Block a user