Skip to content

Commit

Permalink
add lint
Browse files Browse the repository at this point in the history
  • Loading branch information
b3hr4d committed Feb 17, 2024
1 parent 50bd9b9 commit 06122bb
Show file tree
Hide file tree
Showing 31 changed files with 16,741 additions and 4,248 deletions.
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# don't ever lint node_modules
node_modules
# don't lint build output (make sure it's set to your correct build folder name)
build
# don't lint nyc coverage output
coverage
# don't lint declarations folder
declarations
# don't lint test
test
# don't lint dist output
dist
20 changes: 20 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "jest"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"typescript-eslint/no-explicit-any": "off",
"no-console": 1,
"prettier/prettier": 2
},
"env": {
"browser": true,
"node": true,
"jest/globals": true
}
}
2 changes: 1 addition & 1 deletion examples/react-provider/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Login from "Login"
import Notes from "Notes"
import AddNote from "./AddNote"
import { AgentProvider, createReActorContext } from "@ic-reactor/react"
import { backend } from "candid"
import { backend } from "declarations/candid"

const publicKey = crypto.getRandomValues(new Uint8Array(48))

Expand Down
106 changes: 0 additions & 106 deletions examples/react-provider/src/candid/backend.did.d.ts

This file was deleted.

89 changes: 0 additions & 89 deletions examples/react-provider/src/candid/candid.did.d.ts

This file was deleted.

106 changes: 106 additions & 0 deletions examples/react-provider/src/declarations/candid/backend.did.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import type { Principal } from "@dfinity/principal"
import type { ActorMethod } from "@dfinity/agent"

export interface AnonymousUserData {
texts: BigUint64Array | bigint[]
created_at: bigint
decryption_key: [] | [Uint8Array | number[]]
}
export interface AuthenticatedSignature {
signature: Uint8Array | number[]
created_at: bigint
}
export interface LogEntry {
counter: bigint
file: string
line: number
cycle: [] | [bigint]
version: string
message: string
timestamp: bigint
variant: LogVariant
}
export type LogVariant = { info: null } | { warn: null } | { error: null }
export interface OneTimeKey {
tries: number
time_lock: bigint
public_key: Uint8Array | number[]
}
export interface PartitionDetail {
id: number
name: string
size: bigint
}
export type Result =
| { Ok: [Uint8Array | number[], Uint8Array | number[]] }
| { Err: string }
export type Task =
| { CleanUpKeys: null }
| { SendText: { body: string; phone_number: string } }
| { CleanUpAnonymousUsers: null }
| { SendEmail: { subject: string; body: string; email: string } }
| { Initialize: null }
export interface TaskTimerEntry {
task: Task
time: bigint
}
export interface UserData {
texts: BigUint64Array | bigint[]
signature: [] | [AuthenticatedSignature]
public_key: Uint8Array | number[]
}
export interface UserText {
id: string
text: Uint8Array | number[]
}
export interface _SERVICE {
add_simple_note: ActorMethod<[Uint8Array | number[], string], bigint>
anonymous_user: ActorMethod<[Uint8Array | number[]], AnonymousUserData>
anonymous_user_notes: ActorMethod<[Uint8Array | number[]], Array<UserText>>
anonymous_users: ActorMethod<
[],
Array<[Uint8Array | number[], AnonymousUserData]>
>
edit_encrypted_text: ActorMethod<
[bigint, Uint8Array | number[], [] | [Uint8Array | number[]]],
undefined
>
encrypted_ibe_decryption_key_for_caller: ActorMethod<
[Uint8Array | number[]],
Uint8Array | number[]
>
encrypted_symmetric_key_for_caller: ActorMethod<
[Uint8Array | number[]],
Uint8Array | number[]
>
encrypted_texts: ActorMethod<[], Array<UserText>>
get_one_time_key: ActorMethod<[bigint], Uint8Array | number[]>
get_one_time_key_details: ActorMethod<[bigint], OneTimeKey>
ibe_encryption_key: ActorMethod<[], Uint8Array | number[]>
partition_details: ActorMethod<[], Array<PartitionDetail>>
print_log_entries: ActorMethod<[], Array<LogEntry>>
print_log_entries_page: ActorMethod<[bigint, [] | [bigint]], Array<string>>
read_with_one_time_key: ActorMethod<
[bigint, Uint8Array | number[], Uint8Array | number[]],
Result
>
request_two_factor_authentication: ActorMethod<
[Uint8Array | number[]],
string
>
save_encrypted_text: ActorMethod<
[Uint8Array | number[], [] | [Uint8Array | number[]]],
bigint
>
set_one_time_key: ActorMethod<[bigint, Uint8Array | number[]], undefined>
symmetric_key_verification_key: ActorMethod<[], Uint8Array | number[]>
timers: ActorMethod<[], Array<TaskTimerEntry>>
two_factor_verification_key: ActorMethod<[], string>
user_data: ActorMethod<[], UserData>
user_notes: ActorMethod<
[[] | [Uint8Array | number[]]],
[bigint, Array<UserText>]
>
user_simple_notes: ActorMethod<[Uint8Array | number[]], Array<string>>
version: ActorMethod<[], string>
}
Loading

0 comments on commit 06122bb

Please sign in to comment.