wasm.messagechannel.shared.pas 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {
  2. This file is part of the Free Component Library
  3. Webassembly MessageChannel API - shared parts with pas2js
  4. Copyright (c) 2025 by Michael Van Canneyt [email protected]
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. unit wasm.messagechannel.shared;
  12. interface
  13. type
  14. TWasmMessageChannelResult = longint;
  15. TWasmMessageChannelID = longint;
  16. TWasmMessageChannelType = (ctWorker,ctBroadcast);
  17. const
  18. WASMMSGCHANNEL_RESULT_SUCCESS = 0;
  19. WASMMSGCHANNEL_RESULT_INVALIDCHANNEL = -1;
  20. WASMMSGCHANNEL_RESULT_INVALIDDATALEN = -2;
  21. WASMMSGCHANNEL_RESULT_INVALIDTYPE = -3;
  22. WASMMSGCHANNEL_RESULT_UNSUPPORTEDTYPE = -4;
  23. const
  24. MsgChannelExportName = 'messagechannel';
  25. MsgChannelFN_Allocate = 'messagechannel_allocate';
  26. MsgChannelFN_DeAllocate = 'messagechannel_deallocate';
  27. MsgChannelFN_SendUTF8 = 'messagechannel_send_utf8';
  28. MsgChannelFN_SendUTF16 = 'messagechannel_send_utf16';
  29. MsgChannelFN_Listen = 'messagechannel_listen';
  30. MsgChannelFN_OnMessageUTF8 = 'messagechannel_onmesssage_callback_utf8';
  31. MsgChannelFN_OnMessageUTF16 = 'messagechannel_onmesssage_callback_utf16';
  32. implementation
  33. end.