Skip to content

Commit

Permalink
Revise all type definitions and how they import/export
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMBarr committed Jun 12, 2023
1 parent 8562423 commit 72bab7a
Show file tree
Hide file tree
Showing 15 changed files with 947 additions and 920 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ Simply import `OpenLyricsParser`, then pass the contents of an OpenLyrics XML fi
### For TypeScript projects
```typescript
import { readFile } from 'fs';
import { OpenLyricsParser } from 'openlyrics-parser';
import { IOpenLyricsSong } from 'openlyrics-parser/dist/main/parser.model';
import { OpenLyricsParser, IParserRoot } from 'openlyrics-parser';

readFile('example.xml', (contents): void => {
const song: IOpenLyricsSong.IRoot = OpenLyricsParser(contents.toString());
const song: IParserRoot = OpenLyricsParser(contents.toString());
console.log(song);
});
```
Expand All @@ -49,10 +48,9 @@ Simply import `OpenLyricsBuilder`, then pass the song data to it, and it will re

### For TypeScript projects
```typescript
import { OpenLyricsBuilder } from 'openlyrics-parser';
import { INewOpenLyricsSong } from 'openlyrics-parser/dist/main/builder.model';
import { OpenLyricsBuilder, IBuilderOptions } from 'openlyrics-parser';

const opts: INewOpenLyricsSong.IOptions = {
const opts: IBuilderOptions = {
properties: { titles: 'Amazing Grace' },
verses: [
{
Expand Down
113 changes: 56 additions & 57 deletions docs/Builder.md

Large diffs are not rendered by default.

187 changes: 93 additions & 94 deletions docs/Parser.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openlyrics-parser",
"version": "1.1.0",
"version": "1.1.1",
"description": "Parses and extracts data from OpenLyrics files, and creates them!",
"main": "dist/main/index.js",
"typings": "dist/main/index.d.ts",
Expand Down Expand Up @@ -86,7 +86,7 @@
},
"devDependencies": {
"@types/jest": "^29.5.2",
"@types/node": "^20.2.6",
"@types/node": "^20.3.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"eslint": "^8.42.0",
Expand Down
Loading

0 comments on commit 72bab7a

Please sign in to comment.