@defold-typescript/types 0.34.0 → 0.36.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 (67) hide show
  1. package/api-signatures.json +9547 -186
  2. package/api-targets.json +9 -66
  3. package/examples/translations.json +6 -6
  4. package/generated/buffer.d.ts +2 -2
  5. package/generated/collectionfactory.d.ts +2 -2
  6. package/generated/factory.d.ts +13 -12
  7. package/generated/gui.d.ts +23 -23
  8. package/generated/kinds/gui-script.d.ts +0 -4
  9. package/generated/kinds/render-script.d.ts +1 -4
  10. package/generated/kinds/script.d.ts +0 -4
  11. package/generated/model.d.ts +2 -2
  12. package/generated/profiler.d.ts +2 -4
  13. package/generated/render.d.ts +7 -155
  14. package/generated/sys.d.ts +1 -1
  15. package/generated/versions/defold-1.12.4/buffer.d.ts +2 -2
  16. package/generated/versions/defold-1.12.4/collectionfactory.d.ts +2 -2
  17. package/generated/versions/defold-1.12.4/factory.d.ts +13 -12
  18. package/generated/versions/defold-1.12.4/gui.d.ts +23 -23
  19. package/generated/versions/defold-1.12.4/index.d.ts +9 -4
  20. package/generated/versions/defold-1.12.4/model.d.ts +2 -2
  21. package/generated/versions/defold-1.12.4/profiler.d.ts +2 -4
  22. package/generated/versions/defold-1.12.4/render.d.ts +7 -155
  23. package/generated/versions/defold-1.12.4/sys.d.ts +1 -1
  24. package/generated/versions/defold-1.12.4/vmath.d.ts +0 -19
  25. package/generated/versions/defold-1.12.4/window.d.ts +2 -4
  26. package/generated/versions/defold-1.12.4/zlib.d.ts +2 -1
  27. package/generated/versions/defold-1.13.0/buffer.d.ts +2 -2
  28. package/generated/versions/defold-1.13.0/collectionfactory.d.ts +2 -2
  29. package/generated/versions/defold-1.13.0/factory.d.ts +13 -12
  30. package/generated/versions/defold-1.13.0/gui.d.ts +23 -23
  31. package/generated/versions/defold-1.13.0/index.d.ts +9 -4
  32. package/generated/versions/defold-1.13.0/model.d.ts +2 -2
  33. package/generated/versions/defold-1.13.0/profiler.d.ts +2 -4
  34. package/generated/versions/defold-1.13.0/render.d.ts +7 -155
  35. package/generated/versions/defold-1.13.0/sys.d.ts +1 -1
  36. package/generated/versions/defold-1.13.0/vmath.d.ts +0 -19
  37. package/generated/versions/defold-1.13.0/window.d.ts +2 -4
  38. package/generated/versions/defold-1.13.0/zlib.d.ts +2 -1
  39. package/generated/vmath.d.ts +0 -19
  40. package/generated/window.d.ts +2 -4
  41. package/generated/zlib.d.ts +2 -1
  42. package/index.d.ts +2 -4
  43. package/package.json +7 -2
  44. package/scripts/extension-goldens.ts +23 -0
  45. package/scripts/generate-api-signatures.ts +72 -8
  46. package/scripts/materialize-version.ts +15 -1
  47. package/scripts/regen.ts +109 -27
  48. package/scripts/signature-store-fs.ts +1 -0
  49. package/scripts/sync-api-docs.ts +5 -61
  50. package/src/emit-dts.ts +359 -58
  51. package/src/index.ts +1 -0
  52. package/src/optional-correction-provenance.ts +13 -2
  53. package/src/render-overloads.d.ts +46 -0
  54. package/src/vmath-overloads.d.ts +19 -0
  55. package/generated/iac.d.ts +0 -18
  56. package/generated/iap.d.ts +0 -60
  57. package/generated/push.d.ts +0 -66
  58. package/generated/versions/defold-1.12.4/iac.d.ts +0 -18
  59. package/generated/versions/defold-1.12.4/iap.d.ts +0 -60
  60. package/generated/versions/defold-1.12.4/push.d.ts +0 -66
  61. package/generated/versions/defold-1.12.4/webview.d.ts +0 -71
  62. package/generated/versions/defold-1.13.0/iac.d.ts +0 -18
  63. package/generated/versions/defold-1.13.0/iap.d.ts +0 -60
  64. package/generated/versions/defold-1.13.0/push.d.ts +0 -66
  65. package/generated/versions/defold-1.13.0/webview.d.ts +0 -71
  66. package/generated/webview.d.ts +0 -71
  67. package/scripts/fidelity-audit.ts +0 -684
package/src/index.ts CHANGED
@@ -49,6 +49,7 @@ export {
49
49
  type EmitOptions,
50
50
  emitDeclarations,
51
51
  emitSymbolSignatures,
52
+ type SlotTypes,
52
53
  type SymbolSignature,
53
54
  TS_IDENTIFIER,
54
55
  TS_RESERVED_NAMES,
@@ -24,13 +24,19 @@ interface VersionedManifestEntry extends ManifestEntry {
24
24
  readonly editor?: boolean;
25
25
  }
26
26
 
27
+ // The provenance target the committed extension goldens are recorded under. They
28
+ // belong to no engine version: `resolve` applies the same correction table to them.
29
+ export const EXTENSION_GOLDENS_TARGET = "extension-goldens";
30
+
27
31
  // Every runtime module regen emits through the global correction table: the
28
- // default target's manifest plus every older generated target's. Editor-VM
29
- // entries are outside the scope the corrections cover.
32
+ // default target's manifest plus every older generated target's, plus the
33
+ // extension goldens when given. Editor-VM entries are outside the scope the
34
+ // corrections cover.
30
35
  export function retainedSurfaces(
31
36
  defaultTarget: string,
32
37
  defaultManifest: readonly ManifestEntry[],
33
38
  versionedManifest: readonly VersionedManifestEntry[],
39
+ extensionGoldenManifest: readonly ManifestEntry[] = [],
34
40
  ): ProvenanceSurface[] {
35
41
  return [
36
42
  ...defaultManifest.map((entry) => ({
@@ -41,6 +47,11 @@ export function retainedSurfaces(
41
47
  ...versionedManifest
42
48
  .filter((entry) => entry.editor !== true)
43
49
  .map((entry) => ({ target: entry.versionId, namespace: entry.namespace, doc: entry.doc })),
50
+ ...extensionGoldenManifest.map((entry) => ({
51
+ target: EXTENSION_GOLDENS_TARGET,
52
+ namespace: entry.namespace,
53
+ doc: entry.doc,
54
+ })),
44
55
  ];
45
56
  }
46
57
 
@@ -0,0 +1,46 @@
1
+ /** @noSelfInFile */
2
+
3
+ import type { Opaque } from "./core-types";
4
+
5
+ declare global {
6
+ namespace render {
7
+ /**
8
+ * The buffer keys `render.clear` accepts: the three `graphics.BUFFER_TYPE_*`
9
+ * constants the reference names. Declare the clear table with this alias —
10
+ * `LuaMap`'s iterator makes its key parameter invariant, so a
11
+ * `LuaMap<number, ...>` is not assignable however its entries were set.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const buffers = new LuaMap<render.ClearBufferKey, number | Vector4>();
16
+ * buffers.set(graphics.BUFFER_TYPE_COLOR0_BIT, vmath.vector4(0, 0, 0, 0));
17
+ * render.clear(buffers);
18
+ * ```
19
+ */
20
+ type ClearBufferKey =
21
+ | typeof graphics.BUFFER_TYPE_COLOR0_BIT
22
+ | typeof graphics.BUFFER_TYPE_DEPTH_BIT
23
+ | typeof graphics.BUFFER_TYPE_STENCIL_BIT;
24
+ /**
25
+ * Creates a new render target according to the supplied specification table.
26
+ * The parameter table is keyed by buffer type, with one parameter table per
27
+ * attachment; see the reference for the available keys and values.
28
+ *
29
+ * @param parameters - table of buffer parameters, see the description for available keys and values
30
+ * @returns new render target
31
+ */
32
+ function render_target(parameters: Record<string | number, unknown>): Opaque<"render_target">;
33
+ /**
34
+ * Creates a new named render target according to the supplied specification
35
+ * table. The name is used by the profiler and by render target lookups.
36
+ *
37
+ * @param name - render target name
38
+ * @param parameters - table of buffer parameters, see the description for available keys and values
39
+ * @returns new render target
40
+ */
41
+ function render_target(
42
+ name: string,
43
+ parameters: Record<string | number, unknown>,
44
+ ): Opaque<"render_target">;
45
+ }
46
+ }
@@ -56,6 +56,25 @@ declare global {
56
56
  * @returns the lerped number
57
57
  */
58
58
  function lerp(t: number, n1: number, n2: number): number;
59
+ /**
60
+ * Converts euler angles in degrees into a quaternion, reading the x, y and z
61
+ * angles from a vector3.
62
+ * The error is guaranteed to be less than 0.001.
63
+ *
64
+ * @param v - vector3 with euler angles in degrees
65
+ * @returns quaternion describing an equivalent rotation (231 (YZX) rotation sequence)
66
+ */
67
+ function euler_to_quat(v: Vector3): Quaternion;
68
+ /**
69
+ * Converts euler angles (x, y, z) in degrees into a quaternion.
70
+ * The error is guaranteed to be less than 0.001.
71
+ *
72
+ * @param x - rotation around x-axis in degrees
73
+ * @param y - rotation around y-axis in degrees
74
+ * @param z - rotation around z-axis in degrees
75
+ * @returns quaternion describing an equivalent rotation (231 (YZX) rotation sequence)
76
+ */
77
+ function euler_to_quat(x: number, y: number, z: number): Quaternion;
59
78
  /**
60
79
  * Performs an element wise multiplication between two vectors of the same type
61
80
  * The returned value is a vector defined as (e.g. for a vector3):
@@ -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,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 {};