@defold-typescript/types 0.34.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/api-signatures.json +156 -183
  2. package/api-targets.json +9 -66
  3. package/generated/buffer.d.ts +2 -2
  4. package/generated/collectionfactory.d.ts +2 -2
  5. package/generated/factory.d.ts +2 -2
  6. package/generated/gui.d.ts +23 -23
  7. package/generated/kinds/gui-script.d.ts +0 -4
  8. package/generated/kinds/render-script.d.ts +1 -4
  9. package/generated/kinds/script.d.ts +0 -4
  10. package/generated/model.d.ts +2 -2
  11. package/generated/profiler.d.ts +2 -4
  12. package/generated/render.d.ts +2 -150
  13. package/generated/sys.d.ts +1 -1
  14. package/generated/versions/defold-1.12.4/buffer.d.ts +2 -2
  15. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +2 -2
  16. package/generated/versions/defold-1.12.4/factory.d.ts +2 -2
  17. package/generated/versions/defold-1.12.4/gui.d.ts +23 -23
  18. package/generated/versions/defold-1.12.4/index.d.ts +9 -4
  19. package/generated/versions/defold-1.12.4/model.d.ts +2 -2
  20. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -4
  21. package/generated/versions/defold-1.12.4/render.d.ts +2 -150
  22. package/generated/versions/defold-1.12.4/sys.d.ts +1 -1
  23. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -19
  24. package/generated/versions/defold-1.12.4/window.d.ts +2 -4
  25. package/generated/versions/defold-1.13.0/buffer.d.ts +2 -2
  26. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +2 -2
  27. package/generated/versions/defold-1.13.0/factory.d.ts +2 -2
  28. package/generated/versions/defold-1.13.0/gui.d.ts +23 -23
  29. package/generated/versions/defold-1.13.0/index.d.ts +9 -4
  30. package/generated/versions/defold-1.13.0/model.d.ts +2 -2
  31. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -4
  32. package/generated/versions/defold-1.13.0/render.d.ts +2 -150
  33. package/generated/versions/defold-1.13.0/sys.d.ts +1 -1
  34. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -19
  35. package/generated/versions/defold-1.13.0/window.d.ts +2 -4
  36. package/generated/vmath.d.ts +0 -19
  37. package/generated/window.d.ts +2 -4
  38. package/index.d.ts +1 -4
  39. package/package.json +4 -2
  40. package/scripts/extension-goldens.ts +23 -0
  41. package/scripts/generate-api-signatures.ts +40 -1
  42. package/scripts/materialize-version.ts +15 -1
  43. package/scripts/regen.ts +109 -27
  44. package/scripts/signature-store-fs.ts +1 -0
  45. package/scripts/sync-api-docs.ts +5 -61
  46. package/src/emit-dts.ts +212 -21
  47. package/src/optional-correction-provenance.ts +13 -2
  48. package/src/render-overloads.d.ts +29 -0
  49. package/src/vmath-overloads.d.ts +19 -0
  50. package/generated/iac.d.ts +0 -18
  51. package/generated/iap.d.ts +0 -60
  52. package/generated/push.d.ts +0 -66
  53. package/generated/versions/defold-1.12.4/iac.d.ts +0 -18
  54. package/generated/versions/defold-1.12.4/iap.d.ts +0 -60
  55. package/generated/versions/defold-1.12.4/push.d.ts +0 -66
  56. package/generated/versions/defold-1.12.4/webview.d.ts +0 -71
  57. package/generated/versions/defold-1.13.0/iac.d.ts +0 -18
  58. package/generated/versions/defold-1.13.0/iap.d.ts +0 -60
  59. package/generated/versions/defold-1.13.0/push.d.ts +0 -66
  60. package/generated/versions/defold-1.13.0/webview.d.ts +0 -71
  61. package/generated/webview.d.ts +0 -71
  62. package/scripts/fidelity-audit.ts +0 -684
@@ -1,60 +0,0 @@
1
- /** @noSelfInFile */
2
- import type { Opaque } from "../src/core-types";
3
-
4
- declare global {
5
- /**
6
- * Functions and constants for doing in-app purchases. Supported on iOS, Android (Google Play and Amazon) and Facebook Canvas platforms. [icon:ios] [icon:googleplay] [icon:amazon] [icon:facebook]
7
- */
8
- namespace iap {
9
- /**
10
- * Acknowledge a transaction. [icon:attention] Calling iap.acknowledge is required on a successful transaction on Google Play unless iap.finish is called. The transaction.state field must equal iap.TRANS_STATE_PURCHASED.
11
- *
12
- * @param transaction - transaction table parameter as supplied in listener callback
13
- */
14
- function acknowledge(transaction: { ident?: string; state?: number; trans_ident?: string; date?: string; original_trans?: string; receipt?: string; signature?: string; user_id?: string }): void;
15
- /**
16
- * Purchase a product.
17
- *
18
- * @param id - product to buy
19
- * @param options - optional parameters as properties. The following parameters can be set
20
- */
21
- function buy(id: string, options?: { request_id?: string; token?: string }): void;
22
- /**
23
- * Explicitly finish a product transaction. [icon:attention] Calling iap.finish is required on a successful transaction if `auto_finish_transactions` is disabled in project settings. Calling this function with `auto_finish_transactions` set will be ignored and a warning is printed. The `transaction.state` field must equal `iap.TRANS_STATE_PURCHASED`.
24
- *
25
- * @param transaction - transaction table parameter as supplied in listener callback
26
- */
27
- function finish(transaction: { ident?: string; state?: number; trans_ident?: string; date?: string; original_trans?: string; receipt?: string; signature?: string; user_id?: string }): void;
28
- /**
29
- * Get current iap provider
30
- *
31
- * @returns one of the following values
32
- * - `iap.PROVIDER_ID_GOOGLE`
33
- * - `iap.PROVIDER_ID_AMAZON`
34
- * - `iap.PROVIDER_ID_APPLE`
35
- * - `iap.PROVIDER_ID_FACEBOOK`
36
- */
37
- function get_provider_id(): Opaque<"constant">;
38
- /**
39
- * Get a list of all avaliable iap products.
40
- *
41
- * @param ids - table (array) of identifiers to get products from
42
- * @param callback - result callback taking the following parameters
43
- */
44
- function list(ids: string[], callback: (...args: unknown[]) => unknown): void;
45
- /**
46
- * Restore previously purchased products.
47
- *
48
- * @returns value is `true` if current store supports handling restored transactions, otherwise `false`.
49
- */
50
- function restore(): boolean;
51
- /**
52
- * Set the callback function to receive purchase transaction events.
53
- *
54
- * @param listener - listener callback function. Pass an empty function if you no longer wish to receive callbacks.
55
- */
56
- function set_listener(listener: (...args: unknown[]) => unknown): void;
57
- }
58
- }
59
-
60
- export {};
@@ -1,66 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for interacting with local, as well as Apple''s and Google''s push notification services. These API's only exist on mobile platforms. [icon:ios] [icon:android]
5
- */
6
- namespace push {
7
- /**
8
- * Use this function to cancel a previously scheduled local push notification.
9
- * The notification is identified by a numeric id as returned by `push.schedule()`.
10
- *
11
- * @param id - The numeric id of the local push notification
12
- */
13
- function cancel(id: number): void;
14
- /**
15
- * Use this function to cancel a previously issued local push notifications.
16
- */
17
- function cancel_all_issued(): void;
18
- /**
19
- * Returns a table with all data associated with all scheduled local push notifications.
20
- * The table contains key, value pairs where the key is the push notification id and the value is a table with the notification data, corresponding to the data given by `push.get_scheduled(id)`.
21
- *
22
- * @returns Table with all data associated with all scheduled notifications.
23
- */
24
- function get_all_scheduled(): Record<string | number, unknown>;
25
- /**
26
- * Returns a table with all data associated with a specified local push notification.
27
- * The notification is identified by a numeric id as returned by `push.schedule()`.
28
- *
29
- * @param id - The numeric id of the local push notification.
30
- * @returns Table with all data associated with the notification.
31
- */
32
- function get_scheduled(id: number): Record<string | number, unknown>;
33
- /**
34
- * Send a request for push notifications. Note that the notifications table parameter is iOS only and will be ignored on Android.
35
- *
36
- * @param notifications - The types of notifications to listen to. [icon:ios]
37
- * @param callback - Register callback function.
38
- */
39
- function register(notifications: number[], callback: (...args: unknown[]) => unknown): void;
40
- /**
41
- * Local push notifications are scheduled with this function.
42
- * The returned `id` value is uniquely identifying the scheduled notification and can be stored for later reference.
43
- *
44
- * @param time - Number of seconds into the future until the notification should be triggered.
45
- * @param title - Localized title to be displayed to the user if the application is not running.
46
- * @param alert - Localized body message of the notification to be displayed to the user if the application is not running.
47
- * @param payload - JSON string to be passed to the registered listener function.
48
- * @param notification_settings - Table with notification and platform specific fields
49
- */
50
- function schedule(time: number, title: string, alert: string, payload: string, notification_settings: { action?: string; badge_count?: number; priority?: number }): LuaMultiReturn<[number, string]>;
51
- /**
52
- * Set the badge count for application icon. This function is only available on iOS. [icon:ios]
53
- *
54
- * @param count - Badge count
55
- */
56
- function set_badge_count(count: number): void;
57
- /**
58
- * Sets a listener function to listen to push notifications.
59
- *
60
- * @param listener - Listener callback function.
61
- */
62
- function set_listener(listener: (...args: unknown[]) => unknown): void;
63
- }
64
- }
65
-
66
- export {};
@@ -1,18 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for doing inter-app communication. Supported on iOS and Android. [icon:ios] [icon:android]
5
- */
6
- namespace iac {
7
- /**
8
- * Sets the listener function for inter-app communication events.
9
- *
10
- * @param payload - The iac payload.
11
- * @param type - The type of iac, an iac.TYPE_ enumeration. It can be one of the predefined constants below
12
- * - `iac.TYPE_INVOCATION`
13
- */
14
- function set_listener(payload: Record<string | number, unknown>, type: number): void;
15
- }
16
- }
17
-
18
- export {};
@@ -1,60 +0,0 @@
1
- /** @noSelfInFile */
2
- import type { Opaque } from "../../../src/core-types";
3
-
4
- declare global {
5
- /**
6
- * Functions and constants for doing in-app purchases. Supported on iOS, Android (Google Play and Amazon) and Facebook Canvas platforms. [icon:ios] [icon:googleplay] [icon:amazon] [icon:facebook]
7
- */
8
- namespace iap {
9
- /**
10
- * Acknowledge a transaction. [icon:attention] Calling iap.acknowledge is required on a successful transaction on Google Play unless iap.finish is called. The transaction.state field must equal iap.TRANS_STATE_PURCHASED.
11
- *
12
- * @param transaction - transaction table parameter as supplied in listener callback
13
- */
14
- function acknowledge(transaction: { ident?: string; state?: number; trans_ident?: string; date?: string; original_trans?: string; receipt?: string; signature?: string; user_id?: string }): void;
15
- /**
16
- * Purchase a product.
17
- *
18
- * @param id - product to buy
19
- * @param options - optional parameters as properties. The following parameters can be set
20
- */
21
- function buy(id: string, options?: { request_id?: string; token?: string }): void;
22
- /**
23
- * Explicitly finish a product transaction. [icon:attention] Calling iap.finish is required on a successful transaction if `auto_finish_transactions` is disabled in project settings. Calling this function with `auto_finish_transactions` set will be ignored and a warning is printed. The `transaction.state` field must equal `iap.TRANS_STATE_PURCHASED`.
24
- *
25
- * @param transaction - transaction table parameter as supplied in listener callback
26
- */
27
- function finish(transaction: { ident?: string; state?: number; trans_ident?: string; date?: string; original_trans?: string; receipt?: string; signature?: string; user_id?: string }): void;
28
- /**
29
- * Get current iap provider
30
- *
31
- * @returns one of the following values
32
- * - `iap.PROVIDER_ID_GOOGLE`
33
- * - `iap.PROVIDER_ID_AMAZON`
34
- * - `iap.PROVIDER_ID_APPLE`
35
- * - `iap.PROVIDER_ID_FACEBOOK`
36
- */
37
- function get_provider_id(): Opaque<"constant">;
38
- /**
39
- * Get a list of all avaliable iap products.
40
- *
41
- * @param ids - table (array) of identifiers to get products from
42
- * @param callback - result callback taking the following parameters
43
- */
44
- function list(ids: string[], callback: (...args: unknown[]) => unknown): void;
45
- /**
46
- * Restore previously purchased products.
47
- *
48
- * @returns value is `true` if current store supports handling restored transactions, otherwise `false`.
49
- */
50
- function restore(): boolean;
51
- /**
52
- * Set the callback function to receive purchase transaction events.
53
- *
54
- * @param listener - listener callback function. Pass an empty function if you no longer wish to receive callbacks.
55
- */
56
- function set_listener(listener: (...args: unknown[]) => unknown): void;
57
- }
58
- }
59
-
60
- export {};
@@ -1,66 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for interacting with local, as well as Apple''s and Google''s push notification services. These API's only exist on mobile platforms. [icon:ios] [icon:android]
5
- */
6
- namespace push {
7
- /**
8
- * Use this function to cancel a previously scheduled local push notification.
9
- * The notification is identified by a numeric id as returned by `push.schedule()`.
10
- *
11
- * @param id - The numeric id of the local push notification
12
- */
13
- function cancel(id: number): void;
14
- /**
15
- * Use this function to cancel a previously issued local push notifications.
16
- */
17
- function cancel_all_issued(): void;
18
- /**
19
- * Returns a table with all data associated with all scheduled local push notifications.
20
- * The table contains key, value pairs where the key is the push notification id and the value is a table with the notification data, corresponding to the data given by `push.get_scheduled(id)`.
21
- *
22
- * @returns Table with all data associated with all scheduled notifications.
23
- */
24
- function get_all_scheduled(): Record<string | number, unknown>;
25
- /**
26
- * Returns a table with all data associated with a specified local push notification.
27
- * The notification is identified by a numeric id as returned by `push.schedule()`.
28
- *
29
- * @param id - The numeric id of the local push notification.
30
- * @returns Table with all data associated with the notification.
31
- */
32
- function get_scheduled(id: number): Record<string | number, unknown>;
33
- /**
34
- * Send a request for push notifications. Note that the notifications table parameter is iOS only and will be ignored on Android.
35
- *
36
- * @param notifications - The types of notifications to listen to. [icon:ios]
37
- * @param callback - Register callback function.
38
- */
39
- function register(notifications: number[], callback: (...args: unknown[]) => unknown): void;
40
- /**
41
- * Local push notifications are scheduled with this function.
42
- * The returned `id` value is uniquely identifying the scheduled notification and can be stored for later reference.
43
- *
44
- * @param time - Number of seconds into the future until the notification should be triggered.
45
- * @param title - Localized title to be displayed to the user if the application is not running.
46
- * @param alert - Localized body message of the notification to be displayed to the user if the application is not running.
47
- * @param payload - JSON string to be passed to the registered listener function.
48
- * @param notification_settings - Table with notification and platform specific fields
49
- */
50
- function schedule(time: number, title: string, alert: string, payload: string, notification_settings: { action?: string; badge_count?: number; priority?: number }): LuaMultiReturn<[number, string]>;
51
- /**
52
- * Set the badge count for application icon. This function is only available on iOS. [icon:ios]
53
- *
54
- * @param count - Badge count
55
- */
56
- function set_badge_count(count: number): void;
57
- /**
58
- * Sets a listener function to listen to push notifications.
59
- *
60
- * @param listener - Listener callback function.
61
- */
62
- function set_listener(listener: (...args: unknown[]) => unknown): void;
63
- }
64
- }
65
-
66
- export {};
@@ -1,71 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for interacting with webview APIs
5
- */
6
- namespace webview {
7
- /**
8
- * Creates a webview instance. It can show HTML pages as well as evaluate Javascript. The view remains hidden until the first call. There can exist a maximum of 4 webviews at the same time.
9
- * On iOS, the callback will never get a `webview.CALLBACK_RESULT_EVAL_ERROR`, due to the iOS SDK implementation."
10
- *
11
- * @param callback - A callback which receives info about finished requests taking the following parameters:
12
- * @returns The id number of the webview
13
- */
14
- function create(callback: (...args: unknown[]) => unknown): number;
15
- /**
16
- * Destroys an instance of a webview.
17
- *
18
- * @param webview_id - The webview id (returned by the `webview.create()` call)
19
- */
20
- function destroy(webview_id: number): void;
21
- /**
22
- * Evaluates JavaScript within the context of the currently loaded page (if any). Once the request is done, the callback (registered in `webview.create()`) is invoked. The callback will get the result in the `data["result"]` field.
23
- *
24
- * @param webview_id - The webview id
25
- * @param code - The JavaScript code to evaluate
26
- * @returns The id number of the request
27
- */
28
- function eval(webview_id: number, code: string): number;
29
- /**
30
- * Returns the visibility state of the webview.
31
- *
32
- * @param webview_id - The webview id
33
- * @returns Returns `0` if not visible, `1` if it is visible
34
- */
35
- function is_visible(webview_id: number): number;
36
- /**
37
- * Opens a web page in the webview, using HTML data. Once the request is done, the callback (registered in `webview.create()`) is invoked.
38
- *
39
- * @param webview_id - The webview id
40
- * @param html - The HTML data to display
41
- * @param options - A table of options for the request. See `webview.open()`
42
- */
43
- function open_raw(webview_id: number, html: string, options: Record<string | number, unknown>): void;
44
- /**
45
- * Sets the position and size of the webview
46
- *
47
- * @param webview_id - The webview id
48
- * @param x - The x position of the webview
49
- * @param y - The y position of the webview
50
- * @param width - The width of the webview (-1 to match screen width)
51
- * @param height - The height of the webview (-1 to match screen height)
52
- */
53
- function set_position(webview_id: number, x: number, y: number, width: number, height: number): void;
54
- /**
55
- * Set transparency of webview background
56
- *
57
- * @param webview_id - The webview id
58
- * @param transparent - If `true`, the webview background becomes transparent, otherwise opaque.
59
- */
60
- function set_transparent(webview_id: number, transparent: boolean): void;
61
- /**
62
- * Shows or hides a webview
63
- *
64
- * @param webview_id - The webview id
65
- * @param visible - If `0`, hides the webview. If non zero, shows the view
66
- */
67
- function set_visible(webview_id: number, visible: number): void;
68
- }
69
- }
70
-
71
- export {};
@@ -1,18 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for doing inter-app communication. Supported on iOS and Android. [icon:ios] [icon:android]
5
- */
6
- namespace iac {
7
- /**
8
- * Sets the listener function for inter-app communication events.
9
- *
10
- * @param payload - The iac payload.
11
- * @param type - The type of iac, an iac.TYPE_ enumeration. It can be one of the predefined constants below
12
- * - `iac.TYPE_INVOCATION`
13
- */
14
- function set_listener(payload: Record<string | number, unknown>, type: number): void;
15
- }
16
- }
17
-
18
- export {};
@@ -1,60 +0,0 @@
1
- /** @noSelfInFile */
2
- import type { Opaque } from "../../../src/core-types";
3
-
4
- declare global {
5
- /**
6
- * Functions and constants for doing in-app purchases. Supported on iOS, Android (Google Play and Amazon) and Facebook Canvas platforms. [icon:ios] [icon:googleplay] [icon:amazon] [icon:facebook]
7
- */
8
- namespace iap {
9
- /**
10
- * Acknowledge a transaction. [icon:attention] Calling iap.acknowledge is required on a successful transaction on Google Play unless iap.finish is called. The transaction.state field must equal iap.TRANS_STATE_PURCHASED.
11
- *
12
- * @param transaction - transaction table parameter as supplied in listener callback
13
- */
14
- function acknowledge(transaction: { ident?: string; state?: number; trans_ident?: string; date?: string; original_trans?: string; receipt?: string; signature?: string; user_id?: string }): void;
15
- /**
16
- * Purchase a product.
17
- *
18
- * @param id - product to buy
19
- * @param options - optional parameters as properties. The following parameters can be set
20
- */
21
- function buy(id: string, options?: { request_id?: string; token?: string }): void;
22
- /**
23
- * Explicitly finish a product transaction. [icon:attention] Calling iap.finish is required on a successful transaction if `auto_finish_transactions` is disabled in project settings. Calling this function with `auto_finish_transactions` set will be ignored and a warning is printed. The `transaction.state` field must equal `iap.TRANS_STATE_PURCHASED`.
24
- *
25
- * @param transaction - transaction table parameter as supplied in listener callback
26
- */
27
- function finish(transaction: { ident?: string; state?: number; trans_ident?: string; date?: string; original_trans?: string; receipt?: string; signature?: string; user_id?: string }): void;
28
- /**
29
- * Get current iap provider
30
- *
31
- * @returns one of the following values
32
- * - `iap.PROVIDER_ID_GOOGLE`
33
- * - `iap.PROVIDER_ID_AMAZON`
34
- * - `iap.PROVIDER_ID_APPLE`
35
- * - `iap.PROVIDER_ID_FACEBOOK`
36
- */
37
- function get_provider_id(): Opaque<"constant">;
38
- /**
39
- * Get a list of all avaliable iap products.
40
- *
41
- * @param ids - table (array) of identifiers to get products from
42
- * @param callback - result callback taking the following parameters
43
- */
44
- function list(ids: string[], callback: (...args: unknown[]) => unknown): void;
45
- /**
46
- * Restore previously purchased products.
47
- *
48
- * @returns value is `true` if current store supports handling restored transactions, otherwise `false`.
49
- */
50
- function restore(): boolean;
51
- /**
52
- * Set the callback function to receive purchase transaction events.
53
- *
54
- * @param listener - listener callback function. Pass an empty function if you no longer wish to receive callbacks.
55
- */
56
- function set_listener(listener: (...args: unknown[]) => unknown): void;
57
- }
58
- }
59
-
60
- export {};
@@ -1,66 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for interacting with local, as well as Apple''s and Google''s push notification services. These API's only exist on mobile platforms. [icon:ios] [icon:android]
5
- */
6
- namespace push {
7
- /**
8
- * Use this function to cancel a previously scheduled local push notification.
9
- * The notification is identified by a numeric id as returned by `push.schedule()`.
10
- *
11
- * @param id - The numeric id of the local push notification
12
- */
13
- function cancel(id: number): void;
14
- /**
15
- * Use this function to cancel a previously issued local push notifications.
16
- */
17
- function cancel_all_issued(): void;
18
- /**
19
- * Returns a table with all data associated with all scheduled local push notifications.
20
- * The table contains key, value pairs where the key is the push notification id and the value is a table with the notification data, corresponding to the data given by `push.get_scheduled(id)`.
21
- *
22
- * @returns Table with all data associated with all scheduled notifications.
23
- */
24
- function get_all_scheduled(): Record<string | number, unknown>;
25
- /**
26
- * Returns a table with all data associated with a specified local push notification.
27
- * The notification is identified by a numeric id as returned by `push.schedule()`.
28
- *
29
- * @param id - The numeric id of the local push notification.
30
- * @returns Table with all data associated with the notification.
31
- */
32
- function get_scheduled(id: number): Record<string | number, unknown>;
33
- /**
34
- * Send a request for push notifications. Note that the notifications table parameter is iOS only and will be ignored on Android.
35
- *
36
- * @param notifications - The types of notifications to listen to. [icon:ios]
37
- * @param callback - Register callback function.
38
- */
39
- function register(notifications: number[], callback: (...args: unknown[]) => unknown): void;
40
- /**
41
- * Local push notifications are scheduled with this function.
42
- * The returned `id` value is uniquely identifying the scheduled notification and can be stored for later reference.
43
- *
44
- * @param time - Number of seconds into the future until the notification should be triggered.
45
- * @param title - Localized title to be displayed to the user if the application is not running.
46
- * @param alert - Localized body message of the notification to be displayed to the user if the application is not running.
47
- * @param payload - JSON string to be passed to the registered listener function.
48
- * @param notification_settings - Table with notification and platform specific fields
49
- */
50
- function schedule(time: number, title: string, alert: string, payload: string, notification_settings: { action?: string; badge_count?: number; priority?: number }): LuaMultiReturn<[number, string]>;
51
- /**
52
- * Set the badge count for application icon. This function is only available on iOS. [icon:ios]
53
- *
54
- * @param count - Badge count
55
- */
56
- function set_badge_count(count: number): void;
57
- /**
58
- * Sets a listener function to listen to push notifications.
59
- *
60
- * @param listener - Listener callback function.
61
- */
62
- function set_listener(listener: (...args: unknown[]) => unknown): void;
63
- }
64
- }
65
-
66
- export {};
@@ -1,71 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for interacting with webview APIs
5
- */
6
- namespace webview {
7
- /**
8
- * Creates a webview instance. It can show HTML pages as well as evaluate Javascript. The view remains hidden until the first call. There can exist a maximum of 4 webviews at the same time.
9
- * On iOS, the callback will never get a `webview.CALLBACK_RESULT_EVAL_ERROR`, due to the iOS SDK implementation."
10
- *
11
- * @param callback - A callback which receives info about finished requests taking the following parameters:
12
- * @returns The id number of the webview
13
- */
14
- function create(callback: (...args: unknown[]) => unknown): number;
15
- /**
16
- * Destroys an instance of a webview.
17
- *
18
- * @param webview_id - The webview id (returned by the `webview.create()` call)
19
- */
20
- function destroy(webview_id: number): void;
21
- /**
22
- * Evaluates JavaScript within the context of the currently loaded page (if any). Once the request is done, the callback (registered in `webview.create()`) is invoked. The callback will get the result in the `data["result"]` field.
23
- *
24
- * @param webview_id - The webview id
25
- * @param code - The JavaScript code to evaluate
26
- * @returns The id number of the request
27
- */
28
- function eval(webview_id: number, code: string): number;
29
- /**
30
- * Returns the visibility state of the webview.
31
- *
32
- * @param webview_id - The webview id
33
- * @returns Returns `0` if not visible, `1` if it is visible
34
- */
35
- function is_visible(webview_id: number): number;
36
- /**
37
- * Opens a web page in the webview, using HTML data. Once the request is done, the callback (registered in `webview.create()`) is invoked.
38
- *
39
- * @param webview_id - The webview id
40
- * @param html - The HTML data to display
41
- * @param options - A table of options for the request. See `webview.open()`
42
- */
43
- function open_raw(webview_id: number, html: string, options: Record<string | number, unknown>): void;
44
- /**
45
- * Sets the position and size of the webview
46
- *
47
- * @param webview_id - The webview id
48
- * @param x - The x position of the webview
49
- * @param y - The y position of the webview
50
- * @param width - The width of the webview (-1 to match screen width)
51
- * @param height - The height of the webview (-1 to match screen height)
52
- */
53
- function set_position(webview_id: number, x: number, y: number, width: number, height: number): void;
54
- /**
55
- * Set transparency of webview background
56
- *
57
- * @param webview_id - The webview id
58
- * @param transparent - If `true`, the webview background becomes transparent, otherwise opaque.
59
- */
60
- function set_transparent(webview_id: number, transparent: boolean): void;
61
- /**
62
- * Shows or hides a webview
63
- *
64
- * @param webview_id - The webview id
65
- * @param visible - If `0`, hides the webview. If non zero, shows the view
66
- */
67
- function set_visible(webview_id: number, visible: number): void;
68
- }
69
- }
70
-
71
- export {};
@@ -1,71 +0,0 @@
1
- /** @noSelfInFile */
2
- declare global {
3
- /**
4
- * Functions and constants for interacting with webview APIs
5
- */
6
- namespace webview {
7
- /**
8
- * Creates a webview instance. It can show HTML pages as well as evaluate Javascript. The view remains hidden until the first call. There can exist a maximum of 4 webviews at the same time.
9
- * On iOS, the callback will never get a `webview.CALLBACK_RESULT_EVAL_ERROR`, due to the iOS SDK implementation."
10
- *
11
- * @param callback - A callback which receives info about finished requests taking the following parameters:
12
- * @returns The id number of the webview
13
- */
14
- function create(callback: (...args: unknown[]) => unknown): number;
15
- /**
16
- * Destroys an instance of a webview.
17
- *
18
- * @param webview_id - The webview id (returned by the `webview.create()` call)
19
- */
20
- function destroy(webview_id: number): void;
21
- /**
22
- * Evaluates JavaScript within the context of the currently loaded page (if any). Once the request is done, the callback (registered in `webview.create()`) is invoked. The callback will get the result in the `data["result"]` field.
23
- *
24
- * @param webview_id - The webview id
25
- * @param code - The JavaScript code to evaluate
26
- * @returns The id number of the request
27
- */
28
- function eval(webview_id: number, code: string): number;
29
- /**
30
- * Returns the visibility state of the webview.
31
- *
32
- * @param webview_id - The webview id
33
- * @returns Returns `0` if not visible, `1` if it is visible
34
- */
35
- function is_visible(webview_id: number): number;
36
- /**
37
- * Opens a web page in the webview, using HTML data. Once the request is done, the callback (registered in `webview.create()`) is invoked.
38
- *
39
- * @param webview_id - The webview id
40
- * @param html - The HTML data to display
41
- * @param options - A table of options for the request. See `webview.open()`
42
- */
43
- function open_raw(webview_id: number, html: string, options: Record<string | number, unknown>): void;
44
- /**
45
- * Sets the position and size of the webview
46
- *
47
- * @param webview_id - The webview id
48
- * @param x - The x position of the webview
49
- * @param y - The y position of the webview
50
- * @param width - The width of the webview (-1 to match screen width)
51
- * @param height - The height of the webview (-1 to match screen height)
52
- */
53
- function set_position(webview_id: number, x: number, y: number, width: number, height: number): void;
54
- /**
55
- * Set transparency of webview background
56
- *
57
- * @param webview_id - The webview id
58
- * @param transparent - If `true`, the webview background becomes transparent, otherwise opaque.
59
- */
60
- function set_transparent(webview_id: number, transparent: boolean): void;
61
- /**
62
- * Shows or hides a webview
63
- *
64
- * @param webview_id - The webview id
65
- * @param visible - If `0`, hides the webview. If non zero, shows the view
66
- */
67
- function set_visible(webview_id: number, visible: number): void;
68
- }
69
- }
70
-
71
- export {};