Skip to content

Commit

Permalink
Merge pull request #119 from starkbank/fix/typescript-types
Browse files Browse the repository at this point in the history
Specify null types for optional parameters
  • Loading branch information
leoKagohara-Stark authored Mar 19, 2024
2 parents 9f480a4 + 30fccb5 commit ece0c7c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Given a version number MAJOR.MINOR.PATCH, increment:
## [Unreleased]
### Fixed
- tags types parameter reference
- optional parameters types

## [2.23.2] - 2024-02-21
### Changed
Expand Down
6 changes: 3 additions & 3 deletions types/darfPayment/darfPayment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ declare module 'starkbank' {
interestAmount: number
due: string

referenceNumber: string
scheduled: string
tags: string[]
referenceNumber: string | null
scheduled: string | null
tags: string[] | null

readonly id : string
readonly status : string
Expand Down
4 changes: 2 additions & 2 deletions types/deposit/deposit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ declare module 'starkbank' {
amount: number
type: string
status: string
tags: string[]
tags: string[] | null
fee: number
transactionIds: string[]
created: string
updated: string

constructor(params: {
id: string, name: string, taxId: string, bankCode: string, branchCode: string, accountNumber: string, accountType: string, amount: number,
type: string, status: string, tags: string[], fee: number, transactionIds: string[], created: string, updated: string
type: string, status: string, tags: string[] | null, fee: number, transactionIds: string[], created: string, updated: string
})
}

Expand Down
4 changes: 2 additions & 2 deletions types/invoice/invoice.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ declare module 'starkbank' {
due: string
}[]
rules : invoice.Rule[] | null
tags: string[]
tags: string[] | null
descriptions: {
key: string
value?: string
Expand All @@ -79,7 +79,7 @@ declare module 'starkbank' {

constructor(params: {
amount: number, taxId: string, name: string, due?: string, expiration?: number, fine?: number,
interest?: number, discounts?: {percentage: number, due: string}[], tags?: string[],
interest?: number, discounts?: {percentage: number, due: string}[], tags?: string[] | null,
descriptions?: {key: string, value?: string}[], fee?: number | null, pdf?: string | null, link?: string | null,
nominalAmount?: number | null, fineAmount?: number | null, interestAmount?: number | null,
discountAmount?: number | null, id?: string, brcode?: string | null, status?: string | null, transactionIds?: string[] | null, created?: string | null,
Expand Down
4 changes: 2 additions & 2 deletions types/paymentRequest/paymentRequest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare module 'starkbank' {
type: string

due: string
tags: string[]
tags: string[] | null

readonly id: string
readonly amount: number | null
Expand All @@ -54,7 +54,7 @@ declare module 'starkbank' {

constructor(params: {
centerId: string, payment: Transfer | BoletoPayment | UtilityPayment | Transaction | BrcodePayment | {},
type?: string, due?: string, tags?: string[], id?: string | null | null, amount?: number | null,
type?: string, due?: string, tags?: string[] | null, id?: string | null | null, amount?: number | null,
status?: string | null, description?: string | null, actions?: {type: string, id: string,
action: string}[] | null, updated?: string | null, created?: string | null
})
Expand Down
4 changes: 2 additions & 2 deletions types/taxPayment/taxPayment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ declare module 'starkbank' {
barCode: string

scheduled: string
tags: string[]
tags: string[] | null

readonly id : string
readonly type : string
Expand All @@ -51,7 +51,7 @@ declare module 'starkbank' {
readonly created : string

constructor(params: {
description: string, line?: string, barCode?: string, scheduled?: string, tags?: string[],
description: string, line?: string, barCode?: string, scheduled?: string, tags?: string[] | null,
id?: string | null, type?: string | null, status?: string | null, amount?: number | null,
fee?: number | null, transactionIds?: string[] | null, updated?: string | null,
created?: string | null
Expand Down
4 changes: 2 additions & 2 deletions types/transaction/transaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare module 'starkbank' {
externalId: string
receiverId: string

tags: string[]
tags: string[] | null

readonly senderId : string
readonly id : string
Expand All @@ -50,7 +50,7 @@ declare module 'starkbank' {

constructor(params: {
amount: number, description: string, externalId: string, receiverId: string,
tags?: string[], senderId?: string | null, id?: string | null, fee?: number | null,
tags?: string[] | null, senderId?: string | null, id?: string | null, fee?: number | null,
source?: string | null, balance?: number | null, created?: string | null,
})
}
Expand Down
2 changes: 1 addition & 1 deletion types/transfer/transfer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare module 'starkbank' {

constructor(params: {
amount: number, name: string, taxId: string, bankCode: string, branchCode: string, accountNumber: string,
accountType?: string, externalId?: string, tags?: string[], rules?: transfer.Rule[], scheduled?: string,
accountType?: string, externalId?: string, tags?: string[] | null, rules?: transfer.Rule[], scheduled?: string,
description?: string | null, id?: string | null, fee?: number | null, status?: string | null,
transactionIds?: string[] | null, metadata?: {}, created?: string | null, updated?: string | null,
})
Expand Down

0 comments on commit ece0c7c

Please sign in to comment.