Updated Readme and Index

Testing exporting a proper interface with the namespace
This commit is contained in:
Bradyn Glines
2018-01-21 16:59:58 -07:00
parent f838d8b4f6
commit 5c1ff275f6
3 changed files with 36 additions and 6 deletions

View File

@ -85,9 +85,9 @@ SubType.all(): Promise<SubType[]>
All of the calls return generic promises like `Promise<T>` or `Promise<T[]>`. The type is determined from the class making the call. The examples here are using the `Card` class but the usage for the other classes are the same.
```typescript
import { Card, Set, Type, SuperType, SubType, IQuery } from 'pokemon-tcg-sdk-typescript'
import { PokemonTCG } from 'pokemon-tcg-sdk-typescript'
Card.find('xy1')
PokemonTCG.Card.find('xy1')
.then(card => {
// do stuff with the card
})
@ -95,8 +95,8 @@ Card.find('xy1')
// do something with the error
});
let params: IQuery[] = [{ name: 'name', value: 'Charizard' }];
Card.where(params)
let params: PokemonTCG.IQuery[] = [{ name: 'name', value: 'Charizard' }];
PokemonTCG.Card.where(params)
.then(cards => {
// do stuff with the cards
})
@ -104,7 +104,7 @@ Card.where(params)
// do something with the error
});
Card.all()
PokemonTCG.Card.all()
.then(cards => {
// do stuff with the cards
})

28
npm-debug.log Normal file
View File

@ -0,0 +1,28 @@
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'version', 'patch' ]
2 info using npm@3.5.2
3 info using node@v6.11.4
4 info git [ 'status', '--porcelain' ]
5 verbose stack Error: Git working directory not clean.
5 verbose stack M README.md
5 verbose stack M src/index.ts
5 verbose stack at /usr/share/npm/lib/version.js:172:21
5 verbose stack at ChildProcess.exithandler (child_process.js:189:7)
5 verbose stack at emitTwo (events.js:106:13)
5 verbose stack at ChildProcess.emit (events.js:191:7)
5 verbose stack at maybeClose (internal/child_process.js:920:16)
5 verbose stack at Socket.<anonymous> (internal/child_process.js:351:11)
5 verbose stack at emitOne (events.js:96:13)
5 verbose stack at Socket.emit (events.js:188:7)
5 verbose stack at Pipe._handle.close [as _onclose] (net.js:497:12)
6 verbose cwd /home/bradyn/Projects/pokemon-tcg-sdk-typescript
7 error Linux 4.13.0-21-generic
8 error argv "/usr/bin/node" "/usr/bin/npm" "version" "patch"
9 error node v6.11.4
10 error npm v3.5.2
11 error Git working directory not clean.
11 error M README.md
11 error M src/index.ts
12 error If you need help, you may report this error at:
12 error <https://github.com/npm/npm/issues>
13 verbose exit [ 1, true ]

View File

@ -20,12 +20,14 @@ export namespace PokemonTCG {
export type IAttack = BaseIAttack;
export type IAncientAbility = BaseIAncientAbility;
export type IAbility = BaseIAbility;
export type IQuery = BaseIQuery;
// export type IQuery = BaseIQuery;
export type ISet = BaseISet;
export type ISuperType = BaseISuperType;
export type ISubType = BaseISubType;
export type IType = BaseIType;
export interface IQuery extends BaseIQuery {}
export const Card = BaseCard;
export type Card = BaseCard;