I got the following example code from ChatGPT. (TPromise??)

I got the following example code from ChatGPT, but I can't add the TPromise information to the uses clause. Can I use the following sample code?

function TForm1.WaitForDialog: TPromise;
begin
Result := TPromise.New(
procedure (AResolve: TPromise.TResolve; AReject: TPromise.TReject)
var
WaitObj: TEvent; // TEvent 클래스 사용
begin
WaitObj := TEvent.Create(nil, True, False, '');
TJSWindow.setTimeout(
procedure
begin
while document.querySelector('dialog[open]') <> nil do
begin
TJSWindow.setTimeout(
procedure
begin
// wait
end,
50 // 50ms 간격으로 대기
);
end;
WaitObj.SetEvent; // 이벤트 설정
end,
0 // Promise를 즉시 resolve하도록 0ms 뒤에 실행
);
WaitObj.WaitFor(INFINITE); // 이벤트가 설정될 때까지 대기
WaitObj.Free;
AResolve;
end
);
end;

I have no idea where ChatGPT got this code from but TPromise is a class that does not exist in TMS WEB Core.