-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
50 additions
and
51 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,4 @@ | ||
import RoboidentitiesClientNativeClient from './RoboidentitiesNativeClient'; | ||
import { RoboidentitiesClient } from './type'; | ||
|
||
export const roboidentitiesClient: RoboidentitiesClient = new RoboidentitiesClientNativeClient(); |
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
File renamed without changes.
19 changes: 8 additions & 11 deletions
19
frontend/src/services/Roboidentities/RoboidentitiesWebClient/index.ts
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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import { type RoboidentitiesClient } from '..'; | ||
// import { generate_roboname } from 'robo-identities-wasm'; | ||
import { type RoboidentitiesClient } from '../type'; | ||
import { generate_roboname } from 'robo-identities-wasm'; | ||
import { robohash } from './RobohashGenerator'; | ||
|
||
class RoboidentitiesClientWebClient implements RoboidentitiesClient { | ||
public generateRoboname: (initialString: string) => Promise<string> = async (initialString) => { | ||
return new Promise<string>(async (resolve, _reject) => { | ||
// resolve(generate_roboname(initialString)) | ||
resolve(generate_roboname(initialString)); | ||
}); | ||
}; | ||
|
||
public generateRobohash: (initialString: string, size: string) => Promise<string> = async ( | ||
initialString, | ||
size, | ||
) => { | ||
return new Promise<string>(async (resolve, _reject) => { | ||
// resolve(generate_roboname(initialString)) | ||
}); | ||
}; | ||
public generateRobohash: (initialString: string, size: 'small' | 'large') => Promise<string> = | ||
async (initialString, size) => { | ||
return robohash.generate(initialString, size); | ||
}; | ||
} | ||
|
||
export default RoboidentitiesClientWebClient; |
File renamed without changes.
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,4 @@ | ||
import RoboidentitiesClientWebClient from './RoboidentitiesWebClient'; | ||
import { RoboidentitiesClient } from './type'; | ||
|
||
export const roboidentitiesClient: RoboidentitiesClient = new RoboidentitiesClientWebClient(); |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
export interface RoboidentitiesClient { | ||
generateRoboname: (initialString: string) => Promise<string>; | ||
generateRobohash: (initialString: string, size: 'small' | 'large') => Promise<string>; | ||
} |
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