-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDebugClient.js
More file actions
50 lines (46 loc) · 1.08 KB
/
DebugClient.js
File metadata and controls
50 lines (46 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// LICENSE : MIT
"use strict";
export default class HatenaClient {
isLogin() {
return true;
}
loginAsync() {
return new Promise((resolve, reject) => {
resolve();
});
}
/**
*
* @param options
* @returns {*}
* {
url,
comment,
tags = []
}
*/
postLink(options = {}) {
console.log("debug", options);
return Promise.resolve();
}
/**
* テスト用のタグ取得機能
* @returns {Promise<string[]>}
*/
getTags() {
// テスト用の固定タグを返す
return Promise.resolve(["JavaScript", "React", "CodeMirror", "Testing", "Migration"]);
}
/**
* テスト用のコンテンツ取得機能
* @param url
* @returns {Promise<{comment: string, tags: string[], relatedItems: []}>}
*/
getContent(url) {
return Promise.resolve({
comment: "テスト用の自動取得コメント",
tags: ["JavaScript", "Testing"],
relatedItems: []
});
}
}