-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests covering intersectionType
Add more tests and fix printer module indentation
- Loading branch information
1 parent
30b0343
commit a2320ae
Showing
10 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
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
16 changes: 16 additions & 0 deletions
16
tests/specs/references/intersectionType/intermediateTypeLiteral.d.ts
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,16 @@ | ||
interface ErrorHandling { | ||
success: boolean; | ||
error?: string; | ||
} | ||
|
||
interface ArtworksData { | ||
artworks: string[]; | ||
} | ||
|
||
interface Pagination { | ||
page: number; | ||
pageSize: number; | ||
} | ||
|
||
type ArtworksResponse = ArtworksData & ErrorHandling; | ||
type PaginationArtworksResponse = ArtworksResponse & Pagination; |
36 changes: 36 additions & 0 deletions
36
tests/specs/references/intersectionType/intermediateTypeLiteral.fsx
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,36 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
type ErrorHandling = | ||
abstract member success: bool with get, set | ||
abstract member error: string option with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type ArtworksData = | ||
abstract member artworks: ResizeArray<string> with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type Pagination = | ||
abstract member page: float with get, set | ||
abstract member pageSize: float with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type ArtworksResponse = | ||
abstract member artworks: ResizeArray<string> with get, set | ||
abstract member success: bool with get, set | ||
abstract member error: string option with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type PaginationArtworksResponse = | ||
abstract member artworks: ResizeArray<string> with get, set | ||
abstract member success: bool with get, set | ||
abstract member error: string option with get, set | ||
abstract member page: float with get, set | ||
abstract member pageSize: float with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
6 changes: 6 additions & 0 deletions
6
tests/specs/references/intersectionType/mixInterfaceAndTypeLiteral.d.ts
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,6 @@ | ||
interface CreateArtistBioBase { | ||
artistID: string; | ||
thirdParty?: boolean; | ||
} | ||
|
||
type CreateArtistBioRequest = CreateArtistBioBase & { html: string }; |
19 changes: 19 additions & 0 deletions
19
tests/specs/references/intersectionType/mixInterfaceAndTypeLiteral.fsx
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 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
type CreateArtistBioBase = | ||
abstract member artistID: string with get, set | ||
abstract member thirdParty: bool option with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type CreateArtistBioRequest = | ||
abstract member artistID: string with get, set | ||
abstract member thirdParty: bool option with get, set | ||
abstract member html: string with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
15 changes: 15 additions & 0 deletions
15
tests/specs/references/intersectionType/mutiplesInterfacesAndTypeLiterals.d.ts
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,15 @@ | ||
interface CreateArtistBioBase { | ||
artistID: string; | ||
thirdParty?: boolean; | ||
} | ||
|
||
interface Pagination { | ||
page: number; | ||
pageSize: number; | ||
} | ||
|
||
type CreateArtistBioRequest = | ||
CreateArtistBioBase | ||
& { html: string } | ||
& { markdown: string } | ||
& Pagination; |
27 changes: 27 additions & 0 deletions
27
tests/specs/references/intersectionType/mutiplesInterfacesAndTypeLiterals.fsx
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,27 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
type CreateArtistBioBase = | ||
abstract member artistID: string with get, set | ||
abstract member thirdParty: bool option with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type Pagination = | ||
abstract member page: float with get, set | ||
abstract member pageSize: float with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type CreateArtistBioRequest = | ||
abstract member artistID: string with get, set | ||
abstract member thirdParty: bool option with get, set | ||
abstract member html: string with get, set | ||
abstract member markdown: string with get, set | ||
abstract member page: float with get, set | ||
abstract member pageSize: float with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |
12 changes: 12 additions & 0 deletions
12
tests/specs/references/intersectionType/withInterfaceInNamespace.d.ts
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,12 @@ | ||
interface ArtworksData { | ||
artworks: string[]; | ||
} | ||
|
||
namespace Error { | ||
export interface ErrorHandling { | ||
success: boolean; | ||
error?: string; | ||
} | ||
} | ||
|
||
type ArtworksResponse = ArtworksData & Error.ErrorHandling; |
25 changes: 25 additions & 0 deletions
25
tests/specs/references/intersectionType/withInterfaceInNamespace.fsx
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,25 @@ | ||
module rec Glutinum | ||
|
||
open Fable.Core | ||
open System | ||
|
||
[<AllowNullLiteral>] | ||
type ArtworksData = | ||
abstract member artworks: ResizeArray<string> with get, set | ||
|
||
module Error = | ||
|
||
[<AllowNullLiteral>] | ||
type ErrorHandling = | ||
abstract member success: bool with get, set | ||
abstract member error: string option with get, set | ||
|
||
[<AllowNullLiteral>] | ||
type ArtworksResponse = | ||
abstract member artworks: ResizeArray<string> with get, set | ||
abstract member success: bool with get, set | ||
abstract member error: string option with get, set | ||
|
||
(***) | ||
#r "nuget: Fable.Core" | ||
(***) |