Skip to content

Commit f415145

Browse files
yusuke-oba1claude
andauthored
🤖 Merge PR DefinitelyTyped#75181 [safie-sdk] Update to v1.9 by @yusuke-oba1
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a63175d commit f415145

3 files changed

Lines changed: 67 additions & 7 deletions

File tree

types/safie-sdk/index.d.ts

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,48 @@ declare namespace Safie {
8181
function removeToken(): Promise<void>;
8282
}
8383

84+
/**
85+
* SDK全体の設定に関する機能群
86+
*/
87+
namespace Config {
88+
/**
89+
* テーマの設定に関する機能群
90+
*/
91+
namespace Theme {
92+
/** 設定可能なテーマ種別 */
93+
type ThemeType = "light" | "dark" | "system";
94+
/**
95+
* テーマを設定します。
96+
* #### 概要
97+
* - SDK全体のテーマを設定します
98+
* - 現在アクティブな全てのSDKコンポーネント(StreamingPlayer, Timeline等)に即時反映されます
99+
* - "system"を指定するとOSのカラースキーム設定がリアルタイムに反映されます
100+
* - 設定しない場合、デフォルトとして"light"が適用されます
101+
* @param theme テーマ種別
102+
* @throws {@link ErrorDetail} `ThemeType`以外の値を指定した場合にスローされます
103+
* @example
104+
* ```js
105+
* //ダークテーマに設定
106+
* Safie.Config.Theme.set('dark');
107+
* //OSのカラースキームに追従
108+
* Safie.Config.Theme.set('system');
109+
* ```
110+
*/
111+
function set(theme: ThemeType): void;
112+
/**
113+
* 現在設定されているテーマ種別を返します。
114+
* #### 概要
115+
* - 現在設定されているテーマ種別を返します
116+
* @returns 設定されているテーマ種別
117+
* @example
118+
* ```js
119+
* const theme = Safie.Config.Theme.get();
120+
* ```
121+
*/
122+
function get(): ThemeType;
123+
}
124+
}
125+
84126
/**
85127
* デバイス情報の操作に関する機能群
86128
*/
@@ -122,10 +164,9 @@ declare namespace Safie {
122164
serverConnecting: boolean;
123165
};
124166
/**
125-
* @hidden
126-
* デバイスのcapability情報
167+
* デバイスの機能情報のリスト
127168
*/
128-
capabilities?: string[];
169+
capabilities: string[];
129170
}
130171
/**
131172
* デバイス一覧取得の結果
@@ -305,6 +346,7 @@ declare namespace Safie {
305346
* @param options.limit 返却するリストの最大件数 (規定値: 20, 最大値: 100)
306347
* @param options.offset 返却するリストのオフセット (規定値: 0)
307348
* @param options.itemId デバイスに設定されているオプションによる絞り込み
349+
* @param options.deviceIds デバイスIDによる絞り込み
308350
* @returns
309351
* @throws {@link ErrorDetail}
310352
* @example
@@ -317,6 +359,7 @@ declare namespace Safie {
317359
limit?: number;
318360
offset?: number;
319361
itemId?: number;
362+
deviceIds?: string[];
320363
}): Promise<QueryDevicesResult>;
321364
/**
322365
* サムネイル取得
@@ -725,8 +768,6 @@ declare namespace Safie {
725768
* ストリーミングプレイヤー
726769
* #### 概要
727770
* 映像のストリーミング再生を行うプレイヤーです。
728-
* #### 制限:
729-
* - ハイブリッド録画プランを利用のデバイスにおいて、通信を開始後にSafie Developersのアプリケーションの変更及びデバイスオプションの削除を行っても、視聴中は反映されません。
730771
* #### 必要な権限:
731772
* - ライブ + 録画(VOD配信、タイムライン連携時の場合)
732773
* #### 必要なOAuth2.0 scope:

types/safie-sdk/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@types/safie-sdk",
4-
"version": "1.8.9999",
4+
"version": "1.9.9999",
55
"projects": [
66
"https://developers.safie.link/"
77
],
@@ -12,6 +12,10 @@
1212
{
1313
"name": "Safie Inc.",
1414
"githubUsername": "SafieDev"
15+
},
16+
{
17+
"name": "Yusuke Oba",
18+
"githubUsername": "yusuke-oba1"
1519
}
1620
],
1721
"nonNpm": true,

types/safie-sdk/safie-sdk-tests.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,31 @@ async function testAuth(): Promise<void> {
1111
await Safie.Auth.removeToken();
1212
}
1313

14+
function testConfig(): void {
15+
// SDK全体のテーマ設定(v1.9で追加)
16+
const themeTypes: Safie.Config.Theme.ThemeType[] = ["light", "dark", "system"];
17+
themeTypes.forEach(theme => {
18+
Safie.Config.Theme.set(theme);
19+
});
20+
const currentTheme: Safie.Config.Theme.ThemeType = Safie.Config.Theme.get();
21+
console.log(currentTheme);
22+
}
23+
1424
async function testDevices(): Promise<void> {
1525
const devicesAll: Safie.Devices.QueryDevicesResult = await Safie.Devices.queryDevices();
1626
await Safie.Devices.queryDevices({ limit: 30, offset: 10, itemId: 1 });
27+
// デバイスIDによる絞り込み(v1.9で追加)
28+
await Safie.Devices.queryDevices({ deviceIds: ["device1", "device2"] });
1729
devicesAll.list.forEach((device: Safie.Devices.Device) => {
1830
const id: string = device.deviceId;
1931
const modelName: string = device.model.description;
2032
const serial: string = device.serial;
2133
const name: string = device.setting.name;
2234
const streaming: boolean = device.status.videoStreaming;
2335
const connected: boolean = device.status.serverConnecting;
24-
console.log(id, modelName, serial, name, streaming, connected);
36+
// デバイスの機能情報のリスト
37+
const capabilities: string[] = device.capabilities;
38+
console.log(id, modelName, serial, name, streaming, connected, capabilities);
2539
});
2640

2741
const thumbnail: Blob = await Safie.Devices.queryThumbnail({ deviceId: "device" });
@@ -290,6 +304,7 @@ function testErrorHandling(error: Safie.ErrorDetail): void {
290304

291305
// 全テスト関数を参照することで未使用警告を抑止する
292306
testAuth();
307+
testConfig();
293308
testDevices();
294309
testPlayer();
295310
testTimeline();

0 commit comments

Comments
 (0)