-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(config): Add config support (#17)
* feat(config): Add config support * feat(config): Add config support * feat(config): Move examples into example directory * feat(config): Move examples into example directory * feat(config): Make config members non-optional * feat(config): Fix tests * feat(config): Fix README * feat(config): Fix README * feat(config): Fix README * feat(config): Fix README
- Loading branch information
Ben Ross
authored
Apr 23, 2018
1 parent
de2a19c
commit 1520ebc
Showing
11 changed files
with
93 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
awsRegion: 'us-east-1', | ||
foo: 'ignore me', | ||
resolvers: { | ||
poop: arg => { | ||
return 'poop!' | ||
} | ||
} | ||
}; |
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 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 |
---|---|---|
@@ -1,10 +1,21 @@ | ||
export type ResolverMap = { [name: string]: (arg: string) => Promise<string> }; | ||
export type ResolverFunction = (arg: string, config: Config) => Promise<string>; | ||
export type ResolverMap = { | ||
[name: string]: ResolverFunction | ||
}; | ||
export type Document = { [name: string]: string } | ||
|
||
|
||
export class InputDocument { | ||
[name: string]: { | ||
value: string, | ||
value: string; | ||
optional?: boolean | ||
} | ||
} | ||
|
||
export class Config { | ||
constructor() { | ||
this.resolvers = {}; | ||
this.awsRegion = 'us-east-1'; | ||
} | ||
awsRegion: string; | ||
resolvers: ResolverMap | ||
} |
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