summaryrefslogtreecommitdiff
path: root/src/@types
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2019-01-31 17:52:17 +0900
committerGitHub <noreply@github.com>2019-01-31 17:52:17 +0900
commit6439a6c63fb603c9137e5f7f7b65168db7d98cb0 (patch)
tree6d3719a57c0fcfa95a9c45244a218954854b82aa /src/@types
parentUpdate gulp-yaml requirement from 2.0.2 to 2.0.3 (#4053) (diff)
downloadsharkey-6439a6c63fb603c9137e5f7f7b65168db7d98cb0.tar.gz
sharkey-6439a6c63fb603c9137e5f7f7b65168db7d98cb0.tar.bz2
sharkey-6439a6c63fb603c9137e5f7f7b65168db7d98cb0.zip
Create type definition for 'webfinger.js' (#4054)
Diffstat (limited to 'src/@types')
-rw-r--r--src/@types/webfinger.js.d.ts65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/@types/webfinger.js.d.ts b/src/@types/webfinger.js.d.ts
new file mode 100644
index 0000000000..9783a14cba
--- /dev/null
+++ b/src/@types/webfinger.js.d.ts
@@ -0,0 +1,65 @@
+declare module 'webfinger.js' {
+ interface IWebFingerConstructorConfig {
+ tls_only?: boolean;
+ webfist_fallback?: boolean;
+ uri_fallback?: boolean;
+ request_timeout?: number;
+ }
+
+ type JRDProperties = { [type: string]: string };
+
+ interface IJRDLink {
+ rel: string;
+ type?: string;
+ href?: string;
+ template?: string;
+ titles?: { [lang: string]: string };
+ properties?: JRDProperties;
+ }
+
+ interface IJRD {
+ subject?: string;
+ expires?: Date;
+ aliases?: string[];
+ properties?: JRDProperties;
+ links?: IJRDLink[];
+ }
+
+ interface IIDXLinks {
+ 'avatar': IJRDLink[];
+ 'remotestorage': IJRDLink[];
+ 'blog': IJRDLink[];
+ 'vcard': IJRDLink[];
+ 'updates': IJRDLink[];
+ 'share': IJRDLink[];
+ 'profile': IJRDLink[];
+ 'webfist': IJRDLink[];
+ 'camlistore': IJRDLink[];
+ [type: string]: IJRDLink[];
+ }
+
+ interface IIDXProperties {
+ 'name': string;
+ [type: string]: string;
+ }
+
+ interface IIDX {
+ links: IIDXLinks;
+ properties: IIDXProperties;
+ }
+
+ interface ILookupCallbackResult {
+ object: IJRD;
+ json: string;
+ idx: IIDX;
+ }
+
+ type LookupCallback = (err: Error | string, result?: ILookupCallbackResult) => void;
+
+ export class WebFinger {
+ constructor(config?: IWebFingerConstructorConfig);
+
+ public lookup(address: string, cb: LookupCallback): NodeJS.Timeout;
+ public lookupLink(address: string, rel: string, cb: IJRDLink): void;
+ }
+}