Skip to content

Commit

Permalink
change ~ cleanup type info and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Jun 30, 2019
1 parent 15555e1 commit 6bbd9f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ declare const xdg: {
//(win)=> 'C:\\Users\\rivy\\AppData\\Local\\cache'
```
*/
readonly cache?: string;
readonly cache: string;

/**
Directory for user-specific configuration files.
Expand All @@ -29,7 +29,7 @@ declare const xdg: {
//(win)=> 'C:\\Users\\rivy\\AppData\\Roaming\\xdg.config'
```
*/
readonly config?: string;
readonly config: string;

/**
Directory for user-specific data files.
Expand All @@ -44,7 +44,7 @@ declare const xdg: {
//(win)=> 'C:\\Users\\rivy\\AppData\\Roaming\\xdg.data'
```
*/
readonly data?: string;
readonly data: string;

/**
Directory for user-specific non-essential runtime files and other file objects (such as sockets, named pipes, etc).
Expand Down Expand Up @@ -74,7 +74,7 @@ declare const xdg: {
//(win)=> 'C:\\Users\\rivy\\AppData\\Local\\xdg.state'
```
*/
readonly state?: string;
readonly state: string;

/**
Preference-ordered array of base directories to search for configuration files in addition to `.config`.
Expand Down
15 changes: 4 additions & 11 deletions index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import {expectType, expectError} from 'tsd';
import xdg = require('.');

expectType<string | undefined>(xdg.cache);
expectError<string>(xdg.cache);
expectType<string | undefined>(xdg.config);
expectError<string>(xdg.config);
expectType<string | undefined>(xdg.data);
expectError<string>(xdg.data);
expectType<string>(xdg.cache);
expectType<string>(xdg.config);
expectType<string>(xdg.data);
expectType<string | undefined>(xdg.runtime);
expectError<string>(xdg.runtime);
expectType<string | undefined>(xdg.state);
expectError<string>(xdg.state);
expectType<string>(xdg.state);

expectType<readonly string[]>(xdg.configDirs);
expectError<readonly string[]>(xdg.configDirs);
expectType<readonly string[]>(xdg.dataDirs);
expectError<readonly string[]>(xdg.dataDirs);

0 comments on commit 6bbd9f3

Please sign in to comment.