-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create types * remove unnessery db attributes * convert js files to ts * remove empty styles.js
- Loading branch information
1 parent
372b57d
commit e6a48f8
Showing
9 changed files
with
69 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// @ts-ignore Jison doesn't export types | ||
import { parser } from './parser/info.jison'; | ||
import infoDb from './infoDb.js'; | ||
|
||
describe('info graph', () => { | ||
beforeEach(() => { | ||
parser.yy = infoDb; | ||
parser.yy.clear(); | ||
}); | ||
|
||
it('should handle an info definition', () => { | ||
const str = `info`; | ||
parser.parse(str); | ||
|
||
expect(infoDb.getInfo()).toBeFalsy(); | ||
}); | ||
|
||
it('should handle an info definition with showInfo', () => { | ||
const str = `info showInfo`; | ||
parser.parse(str); | ||
|
||
expect(infoDb.getInfo()).toBeTruthy(); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** Created by knut on 15-01-14. */ | ||
import { clear } from '../../commonDb.js'; | ||
import { InfoDb } from './infoTypes.js'; | ||
|
||
let info = false; | ||
|
||
export const setInfo = (inf: boolean): void => { | ||
info = inf; | ||
}; | ||
|
||
export const getInfo = (): boolean => info; | ||
|
||
const db: InfoDb = { | ||
clear, | ||
setInfo, | ||
getInfo, | ||
}; | ||
|
||
export default db; |
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,10 @@ | ||
import { DiagramDb } from '../../diagram-api/types.js'; | ||
|
||
/** | ||
* Info diagram DB. | ||
*/ | ||
export interface InfoDb extends DiagramDb { | ||
clear: () => void; | ||
setInfo: (info: boolean) => void; | ||
getInfo: () => boolean; | ||
} |
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