Skip to content

Commit

Permalink
Adds def_taptic_engine, defold-clipboard, poki-sdk (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinknathan authored Feb 4, 2024
1 parent 70dc972 commit c79fd91
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/TapticEngine/TapticEngine-1.2.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <library version="1.2" src="https://github.com/MaratGilyazov/def_taptic_engine/archive/refs/tags/v1.2.zip" />
/// <reference path="./TapticEngine.d.ts" />
45 changes: 45 additions & 0 deletions packages/TapticEngine/TapticEngine.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/** @noSelfInFile */

/**
* Native extension for Defold with Taptic Engine implementation for iOS
* @url https://github.com/MaratGilyazov/def_taptic_engine
* @noResolution
*/
declare namespace taptic_engine {
export const IMPACT_LIGHT: number;
export const IMPACT_MEDIUM: number;
export const IMPACT_HEAVY: number;
export const NOTIFICATION_SUCCESS: number;
export const NOTIFICATION_WARNING: number;
export const NOTIFICATION_ERROR: number;

/**
* Returns bool flag saying if taptic engine is supported
* @returns {boolean}
*/
export function isSupported(): boolean;

/**
* Call Taptic Engine Impact feedback with given style
* @param {number} style - one of 3 constants `taptic_engine.IMPACT_LIGHT`, `taptic_engine.IMPACT_MEDIUM`, `taptic_engine.IMPACT_HEAVY`
*/
export function impact(
style: typeof IMPACT_HEAVY | typeof IMPACT_LIGHT | typeof IMPACT_MEDIUM,
): void;

/**
* Call Taptic Engine Notification feedback with given type
* @param {number} type - one of 3 constants `taptic_engine.NOTIFICATION_SUCCESS`, `taptic_engine.NOTIFICATION_WARNING`, `taptic_engine.NOTIFICATION_ERROR`
*/
export function notification(
type:
| typeof NOTIFICATION_ERROR
| typeof NOTIFICATION_SUCCESS
| typeof NOTIFICATION_WARNING,
): void;

/**
* Call Taptic Engine Selection feedback
*/
export function selection(): void;
}
4 changes: 4 additions & 0 deletions packages/TapticEngine/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "def_taptic_engine",
"url": "https://github.com/MaratGilyazov/def_taptic_engine"
}
2 changes: 2 additions & 0 deletions packages/defold-clipboard/defold-clipboard-1.24.0.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <library version="1.24.0" src="https://github.com/britzl/defold-clipboard/archive/refs/tags/1.24.0.zip" />
/// <reference path="./defold-clipboard.d.ts" />
20 changes: 20 additions & 0 deletions packages/defold-clipboard/defold-clipboard.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @noSelfInFile */

/**
* Defold native extension to access the clipboard
* @url https://github.com/britzl/defold-clipboard
* @noResolution
*/
declare namespace clipboard {
/**
* Copy text to the clipboard.
* @param {string} text
*/
export function copy(text: string): void;

/**
* Get text from the clipboard.
* @returns {string}
*/
export function paste(): string;
}
4 changes: 4 additions & 0 deletions packages/defold-clipboard/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "defold-clipboard",
"url": "https://github.com/britzl/defold-clipboard"
}
4 changes: 4 additions & 0 deletions packages/poki-sdk/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "poki-sdk",
"url": "https://github.com/defold/extension-poki-sdk"
}
2 changes: 2 additions & 0 deletions packages/poki-sdk/poki-sdk-1.5.0.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <library version="1.5.0" src="https://github.com/defold/extension-poki-sdk/archive/refs/tags/1.5.0.zip" />
/// <reference path="./poki-sdk.d.ts" />
61 changes: 61 additions & 0 deletions packages/poki-sdk/poki-sdk.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/** @noSelfInFile */

/**
* Poki SDK native extension for Defold game engine
* @url https://github.com/defold/extension-poki-sdk
* @noResolution
*/
declare namespace poki_sdk {
/**
* Equivalent to the JS SDK's PokiSDK.gameplayStart()
*/
export function gameplay_start(): void;

/**
* Equivalent to the JS SDK's PokiSDK.gameplayStop()
*/
export function gameplay_stop(): void;

/**
* Equivalent to the JS SDK's PokiSDK.commercialBreak()
* @param {function} callback
*/
export function commercial_break(callback: () => void): void;

/**
* Equivalent to the JS SDK's PokiSDK.rewardedBreak()
* @param {function} callback
*/
export function rewarded_break(callback: () => void): void;

/**
* Equivalent to the JS SDK's PokiSDK.setDebug(value)
* @param {boolean} is_debug
*/
export function set_debug(is_debug: boolean): void;

/**
* Equivalent to the JS SDK's PokiSDK.captureError(error_string)
* @param {string} error
*/
export function capture_error(error: string): void;

/**
* Equivalent to the JS SDK's PokiSDK.shareableURL({}).then(url => {})
* @param {table} params
* @param {function} callback
*/
export function shareable_url(params: {}, callback: () => void): void;

/**
* Equivalent to the JS SDK's PokiSDK.getURLParam('id')
* @param {string} key
* @returns {string}
*/
export function get_url_param(key: string): string;

/**
* @deprecated since version 1.5.0
*/
export function is_ad_blocked(): boolean;
}

0 comments on commit c79fd91

Please sign in to comment.