@uzuhq/code-sdk 0.8.9 → 0.8.11
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.
- package/README.md +15 -0
- package/dist/dev-globals.d.ts +1 -1
- package/dist/{dev-hooks-B9mpXwaP.d.ts → dev-hooks-7UDN8Xac.d.ts} +168 -162
- package/dist/index.d.ts +48 -34
- package/dist/index.js +544 -519
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -296,6 +296,21 @@ changeRoom(null); // デフォルトルーム(全員が同じ音声チャン
|
|
|
296
296
|
- 初期状態ではすべてのプレイヤーがデフォルトルーム(`null`)に所属する
|
|
297
297
|
- `roomId` に文字列を指定すると、そのプレイヤーは指定ルームへ移動する
|
|
298
298
|
|
|
299
|
+
### `haptic(kind: 'light' | 'medium' | 'heavy'): void`
|
|
300
|
+
|
|
301
|
+
端末を短く振動させる。アプリ内では `navigator.vibrate` が効かないので、代わりにこれを使う。
|
|
302
|
+
|
|
303
|
+
```ts
|
|
304
|
+
import { haptic } from '@uzuhq/code-sdk';
|
|
305
|
+
|
|
306
|
+
haptic('light'); // 手がかり入手など
|
|
307
|
+
haptic('heavy'); // 画面が揺れる演出など
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
- 長さは指定できない(iOS の触覚は種類でしか選べないため、段階で渡す)
|
|
311
|
+
- 端末の設定で触覚を切っている人には効かない
|
|
312
|
+
- ブラウザで単独で開いたときは `navigator.vibrate` にフォールバックする
|
|
313
|
+
|
|
299
314
|
### `finishGame(): void`
|
|
300
315
|
|
|
301
316
|
ゲームを終えて、この端末のプレイ画面を閉じる。ホストはイベントを終了扱いにし、呼んだプレイヤーを退出させる。
|
package/dist/dev-globals.d.ts
CHANGED