-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add types for profiles (#1383)
* export profile functions for wallet-sdk * feat: add PublicPersonProfile type * fix: export PublicPersonProfile type * fix: type is required * fix: add base PublicProfile type * fix: add missing type * fix: adopt Profile type from wallet-sdk * chore: fix lint Co-authored-by: friedger <mail@friedger.de> Co-authored-by: janniks <janniks@users.noreply.github.com>
- Loading branch information
1 parent
fef15b4
commit 872478c
Showing
4 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
const PERSON_TYPE = 'Person'; | ||
const CONTEXT = 'http://schema.org'; | ||
const IMAGE_TYPE = 'ImageObject'; | ||
|
||
export type ProfileType = typeof PERSON_TYPE; | ||
|
||
export interface ProfileImage { | ||
'@type': typeof IMAGE_TYPE; | ||
name?: string; | ||
contentUrl?: string; | ||
[k: string]: unknown; | ||
} | ||
|
||
export interface PublicProfileBase { | ||
'@type'?: ProfileType; | ||
'@context'?: typeof CONTEXT; | ||
apps?: { | ||
[origin: string]: string; | ||
}; | ||
appsMeta?: { | ||
[origin: string]: { | ||
publicKey: string; | ||
storage: string; | ||
}; | ||
}; | ||
} | ||
|
||
export interface PublicPersonProfile extends PublicProfileBase { | ||
'@type': typeof PERSON_TYPE; | ||
name?: string; | ||
givenName?: string; | ||
familyName?: string; | ||
description?: string; | ||
image?: ProfileImage[]; | ||
website?: { | ||
'@type'?: string; | ||
url?: string; | ||
[k: string]: unknown; | ||
}[]; | ||
account?: { | ||
'@type'?: string; | ||
service?: string; | ||
identifier?: string; | ||
proofType?: string; | ||
proofUrl?: string; | ||
proofMessage?: string; | ||
proofSignature?: string; | ||
[k: string]: unknown; | ||
}[]; | ||
worksFor?: { | ||
'@type'?: string; | ||
'@id'?: string; | ||
[k: string]: unknown; | ||
}[]; | ||
knows?: { | ||
'@type'?: string; | ||
'@id'?: string; | ||
[k: string]: unknown; | ||
}[]; | ||
address?: { | ||
'@type'?: string; | ||
streetAddress?: string; | ||
addressLocality?: string; | ||
postalCode?: string; | ||
addressCountry?: string; | ||
[k: string]: unknown; | ||
}; | ||
birthDate?: string; | ||
taxID?: string; | ||
[k: string]: unknown; | ||
} | ||
|
||
export type PublicProfile = PublicPersonProfile; |
872478c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
stacksjs-docs – ./
stacksjs.vercel.app
stacksjs-docs-blockstack.vercel.app
stacks-js.vercel.app
stacks.js.org
stacksjs-docs-git-master-blockstack.vercel.app