-
Notifications
You must be signed in to change notification settings - Fork 18
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
13 changed files
with
155 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
type ObjectId = string; | ||
|
||
export enum ItemCategory { | ||
Tutorial = 'Tutorial', | ||
Opinion = 'Opinion', | ||
Vlog = 'Vlog', | ||
} | ||
|
||
export interface ItemVote { | ||
userId: ObjectId; | ||
created: Date; | ||
} | ||
|
||
export default interface Item { | ||
_id: ObjectId; | ||
title: string; | ||
description: string; | ||
created: Date; | ||
updated: Date; | ||
category: ItemCategory; | ||
createdBy: ObjectId; | ||
status: 'open' | 'accepted' | 'declined' | 'completed'; | ||
votes: ItemVote[]; | ||
} |
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
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
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,85 @@ | ||
// source: https://github.com/nextauthjs/next-auth/pull/220 | ||
declare module 'next-auth/client' { | ||
// Minimum TypeScript Version: 3.8 | ||
import { IncomingMessage } from 'http'; | ||
|
||
interface Session { | ||
user: { | ||
name: string; | ||
email: string; | ||
image: string; | ||
}; | ||
accessToken: string; | ||
expires: string; | ||
} | ||
|
||
interface GetProvidersResponse { | ||
[provider: string]: Provider; | ||
} | ||
|
||
interface Provider { | ||
id: string; | ||
name: string; | ||
type: string; | ||
signinUrl: string; | ||
callbackUrl: string; | ||
} | ||
|
||
interface GenericObject { | ||
[key: string]: any; | ||
} | ||
|
||
declare function useSession(): [Session, boolean]; | ||
declare function getSession(context: NextContext): Promise<Session | null>; | ||
declare function session(context: NextContext): Promise<Session | null>; | ||
declare function getProviders( | ||
context: NextContext | ||
): Promise<GetProvidersResponse | null>; | ||
declare function providers( | ||
context: NextContext | ||
): Promise<GetProvidersResponse | null>; | ||
declare function getCsrfToken(context: NextContext): Promise<string | null>; | ||
declare function csrfToken(context: NextContext): Promise<string | null>; | ||
declare function signin( | ||
provider: Provider | string, | ||
data?: GenericObject | ||
): Promise<void>; | ||
declare function signout(context?: NextContext): Promise<void>; | ||
|
||
export { | ||
useSession, | ||
getSession, | ||
session, | ||
getProviders, | ||
providers, | ||
getCsrfToken, | ||
csrfToken, | ||
signin, | ||
signout, | ||
}; | ||
export type { Session }; | ||
|
||
/** | ||
* TODO: `dtslint` throws when parsing Next types... the following types are copied directly from `next/types` ... | ||
* @see https://github.com/microsoft/dtslint/issues/297 | ||
*/ | ||
|
||
interface NextApiRequest extends IncomingMessage { | ||
query: { | ||
[key: string]: string | string[]; | ||
}; | ||
cookies: { | ||
[key: string]: string; | ||
}; | ||
body: any; | ||
env: Env; | ||
} | ||
|
||
interface NextContext { | ||
req: NextApiRequest; | ||
} | ||
|
||
interface Env { | ||
[key: string]: 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