Skip to content

Commit

Permalink
fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
ejnshtein committed Nov 1, 2020
1 parent df896c3 commit b584213
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
LoginPayload,
NyaaApiRequestResult,
NyaaRequestOptions
} from './types'
} from '../types'

const { version: packageVersion } = JSON.parse(
fs.readFileSync('./package.json', 'utf-8')
Expand Down
4 changes: 2 additions & 2 deletions src/Nyaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
NyaaApiRequestResult,
NyaaRequestOptions,
SearchOptions
} from './types'
} from '../types'
import { Agent } from './Agent'
import { Profile, SearchResult, ViewTorrent } from './types/nyaa'
import { Profile, SearchResult, ViewTorrent } from '../types/nyaa'

const DefaultOptions: AgentOptions = {
host: 'https://nyaa.si',
Expand Down
4 changes: 2 additions & 2 deletions src/Scraper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Profile,
SearchResult,
ViewTorrent
} from './types/nyaa'
} from '../types/nyaa'
import { URL } from 'url'

export const getCSRFToken = (html: string): string => {
Expand Down Expand Up @@ -263,7 +263,7 @@ export const parseTorrent = (
}
}

function getEntry(entry: string): Entry {
export function getEntry(entry: string): Entry {
switch (entry) {
case 'danger':
return '[Remake]'
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { Agent } from './Agent'
export { Nyaa } from './Nyaa'
export { NyaaRss } from './NyaaRss'
export * from './Agent'
export * from './Nyaa'
export * from './NyaaRss'
export * as Scraper from './Scraper'
export * from '../types/index'
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
"declaration": true,
"esModuleInterop": true,
"skipLibCheck": true,
"outDir": "./dist",
"moduleResolution": "node",
"types": ["node"]
"allowJs": true,
"outDir": "dist",
"moduleResolution": "Node",
"baseUrl": "."
},
"include": [
"src/**/*"
"src/**/*",
"types"
]
}
2 changes: 2 additions & 0 deletions src/types/index.d.ts → types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { RequestOptions } from '@ejnshtein/smol-request'

export * from './nyaa'

export interface Cookie {
domain?: string
expires?: Date
Expand Down
File renamed without changes.

0 comments on commit b584213

Please sign in to comment.