Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partly repair gun types #1154

Merged
merged 2 commits into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ isolate*.log
.localStorage
/types/**/*.ts
!/types/**/*.d.ts
!/types/**/*.test-d.ts
/gun.ts
/temp/
4 changes: 2 additions & 2 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IGunStatic } from './types/static';
import { IGun } from './types/gun/IGun';
declare global {
var Gun: IGunStatic;
var Gun: IGun;
}
6 changes: 3 additions & 3 deletions gun.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { IGunStatic } from './types/static';
declare const Gun: IGunStatic;
export = Gun;
import { IGun } from './types/gun/IGun';
declare const Gun: IGun;
export = Gun;
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { IGunStatic } from './types/static';
declare const Gun: IGunStatic;
import { IGun } from './types/gun/IGun';
declare const Gun: IGun;
export = Gun;
308 changes: 0 additions & 308 deletions types/chain.d.ts

This file was deleted.

7 changes: 7 additions & 0 deletions types/gun/AckCallback.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export declare type AckCallback = (ack: {
err: string;
ok: undefined;
} | {
err: undefined;
ok: string;
}) => void;
20 changes: 20 additions & 0 deletions types/gun/AuthCallback.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ISEAPair } from "../sea/ISEAPair";

export type AuthCallback = (ack: {
ack: 2;
ing: false,
id: number,
get: string;
on: (tag:unknown , args:unknown, as: unknown) => unknown;
put: {
alias: string;
auth: string;
epub: string;
pub: string;
};
sea: ISEAPair;
err?: undefined;
soul: string;
} | {
err: string;
}) => void
9 changes: 9 additions & 0 deletions types/gun/CreateCallback.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export type CreateCallback = (ack: {
ok: 0;
pub: string;
err?:undefined
} | {
ok?: 0;
pub?: string;
err: string;
}) => any
Loading