JSPM

  • Created
  • Published
  • Downloads 74
  • Score
    100M100P100Q74292F
  • License MIT

Functional Types for Entities' functions

Package Exports

  • functional-types
  • functional-types/lib/FileType
  • functional-types/lib/Folder
  • functional-types/lib/Schema
  • functional-types/lib/TableAnnotation

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (functional-types) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

functional-types

functional-types

Index

Modules

functional-types

functional-types

Interfaces

functional-types"Folder/index"Attributes

Interface: Attributes

Hierarchy

  • Attributes

Index

Properties

Properties

folder

folder: string

Defined in src/Folder/index.ts:29


id

id: string

Defined in src/Folder/index.ts:28


name

name: string

Defined in src/Folder/index.ts:30


type

type: FT.FileType

Defined in src/Folder/index.ts:31

functional-types"Folder/index"Folder

Interface: Folder

Hierarchy

  • Folder

Index

Properties

Properties

created_at

created_at: string

Defined in src/Folder/index.ts:23


id

id: string

Defined in src/Folder/index.ts:21


name

name: string

Defined in src/Folder/index.ts:22


updated_at

updated_at: string

Defined in src/Folder/index.ts:24

functional-types"Folder/index"Metadata

Interface: Metadata

Hierarchy

  • Metadata

Index

Properties

Properties

bucket

bucket: string

Defined in src/Folder/index.ts:40


content_type

content_type: string

Defined in src/Folder/index.ts:42


created_at

created_at: string

Defined in src/Folder/index.ts:44


generation

generation: string

Defined in src/Folder/index.ts:41


id

id: string

Defined in src/Folder/index.ts:36


kind

kind: string

Defined in src/Folder/index.ts:35


media_link: string

Defined in src/Folder/index.ts:38


name

name: string

Defined in src/Folder/index.ts:39


self_link: string

Defined in src/Folder/index.ts:37


size

size: string

Defined in src/Folder/index.ts:43


updated_at

updated_at: string

Defined in src/Folder/index.ts:45

functional-types"Label"Label

Interface: Label

Hierarchy

  • Label

Index

Properties

Properties

color

color: string

Defined in src/Label.ts:6


id

id: string

Defined in src/Label.ts:4


name

name: string

Defined in src/Label.ts:5

functional-types"Schema/index"FileMatcher

Interface: FileMatcher

Hierarchy

Index

Properties

Properties

Optional child

child? : FileMatcher

Defined in src/Schema/index.ts:30


name

name: string

Inherited from Matcher.name

Defined in src/Schema/index.ts:25


regex

regex: string

Inherited from Matcher.regex

Defined in src/Schema/index.ts:24


timestamp_capture_group

timestamp_capture_group: number

Inherited from Matcher.timestamp_capture_group

Defined in src/Schema/index.ts:26


type

type: Type

Defined in src/Schema/index.ts:31

functional-types"Schema/index"Gettable

Interface: Gettable

Hierarchy

  • Gettable

Index

Properties

Properties

attributes

attributes: Matcher[]

Defined in src/Schema/index.ts:36


file

file: FileMatcher

Defined in src/Schema/index.ts:35

functional-types"Schema/index"Matcher

Interface: Matcher

Hierarchy

Index

Properties

Properties

name

name: string

Defined in src/Schema/index.ts:25


regex

regex: string

Defined in src/Schema/index.ts:24


timestamp_capture_group

timestamp_capture_group: number

Defined in src/Schema/index.ts:26

functional-types"Schema/index"Schema

Interface: Schema

Hierarchy

Index

Properties

Properties

created_at

created_at: Date

Defined in src/Schema/index.ts:44


gettables

gettables: Gettables

Defined in src/Schema/index.ts:43


id

id: string

Defined in src/Schema/index.ts:42


updated_at

updated_at: Date

Defined in src/Schema/index.ts:45

functional-types"Schema/index"VersionedSchema

Interface: VersionedSchema

Hierarchy

Index

Properties

Properties

created_at

created_at: Date

Inherited from Schema.created_at

Defined in src/Schema/index.ts:44


gettables

gettables: Gettables

Inherited from Schema.gettables

Defined in src/Schema/index.ts:43


id

id: string

Inherited from Schema.id

Defined in src/Schema/index.ts:42


schema_id

schema_id: string

Defined in src/Schema/index.ts:49


updated_at

updated_at: Date

Inherited from Schema.updated_at

Defined in src/Schema/index.ts:45

functional-types"TableAnnotation"TableAnnotation

Interface: TableAnnotation

Hierarchy

  • TableAnnotation

Index

Properties

Properties

boundingBoxesByPage

boundingBoxesByPage: BoundingBoxesByPage

Defined in src/TableAnnotation.ts:24


created_at

created_at: string

Defined in src/TableAnnotation.ts:25


file

file: string

Defined in src/TableAnnotation.ts:23


id

id: string

Defined in src/TableAnnotation.ts:22


updated_at

updated_at: string

Defined in src/TableAnnotation.ts:26

functional-types"Vertex/index"BoundingBox

Interface: BoundingBox

Hierarchy

Index

Properties

Properties

boundingPoly

boundingPoly: Poly

Defined in src/Vertex/index.ts:50


columns

columns: Line[]

Defined in src/Vertex/index.ts:52


rows

rows: Line[]

Defined in src/Vertex/index.ts:51

functional-types"Vertex/index"Corners

Interface: Corners

Hierarchy

  • Corners

Index

Properties

Properties

end

end: Vertex

Defined in src/Vertex/index.ts:74


start

start: Vertex

Defined in src/Vertex/index.ts:73

functional-types"Vertex/index"LabeledBoundingBox

Interface: LabeledBoundingBox

Hierarchy

Index

Properties

Properties

boundingPoly

boundingPoly: Poly

Inherited from BoundingBox.boundingPoly

Defined in src/Vertex/index.ts:50


columns

columns: Line[]

Inherited from BoundingBox.columns

Defined in src/Vertex/index.ts:52


id

id: string

Defined in src/Vertex/index.ts:68


label

label: string

Defined in src/Vertex/index.ts:69


rows

rows: Line[]

Inherited from BoundingBox.rows

Defined in src/Vertex/index.ts:51

functional-types"Vertex/index"Rectangle

Interface: Rectangle

Hierarchy

  • Rectangle

Index

Properties

Properties

x0

x0: number

Defined in src/Vertex/index.ts:78


x1

x1: number

Defined in src/Vertex/index.ts:80


y0

y0: number

Defined in src/Vertex/index.ts:79


y1

y1: number

Defined in src/Vertex/index.ts:81

functional-types"Vertex/index"Vertex

Interface: Vertex

Hierarchy

  • Vertex

Index

Properties

Properties

x

x: number

Defined in src/Vertex/index.ts:38


y

y: number

Defined in src/Vertex/index.ts:39

Modules

functional-types"DateTime"

Module: "DateTime"

Index

Variables

Functions

Variables

Const getCurrentUnixTimestamp

getCurrentUnixTimestamp: function = Date.now

Defined in src/DateTime.ts:14

getCurrentUnixTimestamp :: () -> Int
Type declaration:

▸ (): number

Functions

Const getCurrentDate

getCurrentDate(): Date

Defined in src/DateTime.ts:16

Returns: Date


Const getUnixTimestamp

getUnixTimestamp(date: Date): number

Defined in src/DateTime.ts:6

getUnixTimestamp :: Date -> Int

Parameters:

Name Type
date Date

Returns: number

functional-types"FileType"

Module: "FileType"

Index

Type aliases

Variables

Functions

Type aliases

ContentType

Ƭ ContentType: DocumentContentType | ImageContentType

Defined in src/FileType.ts:26


DocumentContentType

Ƭ DocumentContentType: "application/pdf" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/json"

Defined in src/FileType.ts:19


DocumentType

Ƭ DocumentType: "pdf" | "excel" | "json"

Defined in src/FileType.ts:13


FileType

Ƭ FileType: DocumentType | ImageType

Defined in src/FileType.ts:17


ImageContentType

Ƭ ImageContentType: "image/png" | "image/jpeg"

Defined in src/FileType.ts:24


ImageType

Ƭ ImageType: "png" | "jpeg"

Defined in src/FileType.ts:15

Variables

Const contentTypes

contentTypes: ContentType[] = values(FileTypeToContentType)

Defined in src/FileType.ts:151

contentTypes: [ContentType]

Const documentTypes

documentTypes: DocumentType[] = keys(DocumentTypeToContentType)

Defined in src/FileType.ts:112

documentTypes: [DocumentType]

Const fileContentTypes

fileContentTypes: DocumentContentType[] = values( DocumentTypeToContentType )

Defined in src/FileType.ts:133

contentTypes: [DocumentContentType]

Const fileTypes

fileTypes: FileType[] = keys(FileTypeToContentType)

Defined in src/FileType.ts:126

fileTypes: [FileType]

Const fromContentType

fromContentType: function = prop( __, ContentTypeToFileType )

Defined in src/FileType.ts:252

fromContentType :: ContentType -> FileType
Type declaration:

▸ (contentType: ContentType): FileType

Parameters:

Name Type
contentType ContentType

Const fromDocumentContentType

fromDocumentContentType: function = prop(__, ContentTypeToDocumentType)

Defined in src/FileType.ts:234

fromDocumentContentType :: DocumentContentType -> DocumentType
Type declaration:

▸ (contentType: DocumentContentType): DocumentType

Parameters:

Name Type
contentType DocumentContentType

Const fromImageContentType

fromImageContentType: function = prop(__, ContentTypeToImageType)

Defined in src/FileType.ts:243

fromImageContentType :: DocumentContentType -> DocumentType
Type declaration:

▸ (contentType: ImageContentType): ImageType

Parameters:

Name Type
contentType ImageContentType

Const imageContentTypes

imageContentTypes: ImageContentType[] = values( ImageTypeToContentType )

Defined in src/FileType.ts:142

imageContentTypes: [DocumentContentType]

Const imageTypes

imageTypes: ImageType[] = keys(ImageTypeToContentType)

Defined in src/FileType.ts:119

imageTypes: [DocumentType]

Const toContentType

toContentType: function = prop( __, FileTypeToContentType )

Defined in src/FileType.ts:224

toContentType :: FileType -> ContentType
Type declaration:

▸ (fileType: FileType): ContentType

Parameters:

Name Type
fileType FileType

Const toDocumentContentType

toDocumentContentType: function = prop(__, DocumentTypeToContentType)

Defined in src/FileType.ts:206

toDocumentContentType :: DocumentType -> DocumentContentType
Type declaration:

▸ (fileType: DocumentType): DocumentContentType

Parameters:

Name Type
fileType DocumentType

Const toImageContentType

toImageContentType: function = prop(__, ImageTypeToContentType)

Defined in src/FileType.ts:215

toImageContentType :: DocumentType -> ImageContentType
Type declaration:

▸ (imageType: ImageType): ImageContentType

Parameters:

Name Type
imageType ImageType

Functions

Const isContentType

isContentType(a: unknown): a is ContentType

Defined in src/FileType.ts:198

isContentType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is ContentType


Const isDocumentContentType

isDocumentContentType(a: unknown): a is DocumentContentType

Defined in src/FileType.ts:182

isDocumentContentType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is DocumentContentType


Const isDocumentType

isDocumentType(a: unknown): a is DocumentType

Defined in src/FileType.ts:158

isDocumentType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is DocumentType


Const isFileType

isFileType(a: unknown): a is ImageType

Defined in src/FileType.ts:174

isFileType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is ImageType


Const isImageContentType

isImageContentType(a: unknown): a is ImageContentType

Defined in src/FileType.ts:190

isDocumentContentType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is ImageContentType


Const isImageType

isImageType(a: unknown): a is ImageType

Defined in src/FileType.ts:166

isImageType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is ImageType

functional-types"Folder/Arbitraries"

Module: "Folder/Arbitraries"

Index

Functions

Functions

Const file

file(): Arbitrary‹File

Defined in src/Folder/Arbitraries.ts:47

Returns: Arbitrary‹File


Const filesByType

filesByType(): Arbitrary‹FilesByType

Defined in src/Folder/Arbitraries.ts:57

Returns: Arbitrary‹FilesByType


Const folder

folder(): Arbitrary‹Folder

Defined in src/Folder/Arbitraries.ts:29

Returns: Arbitrary‹Folder


Const invalidFolderObject

invalidFolderObject(): Arbitrary‹Record‹string, any››

Defined in src/Folder/Arbitraries.ts:5

Returns: Arbitrary‹Record‹string, any››


Const metadata

metadata(): Arbitrary‹Metadata

Defined in src/Folder/Arbitraries.ts:32

Returns: Arbitrary‹Metadata


Const nonFolderObject

nonFolderObject(): Arbitrary‹unknown›

Defined in src/Folder/Arbitraries.ts:15

Returns: Arbitrary‹unknown›

functional-types"Folder/index"

Module: "Folder/index"

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

File

Ƭ File: Attributes & object

Defined in src/Folder/index.ts:48


FilesByType

Ƭ FilesByType: Record‹FT.DocumentType, File[]›

Defined in src/Folder/index.ts:50

Variables

Const getAttributesFromName

getAttributesFromName: function = pipe( split('/'), E.fromPredicate( (segments: string[]) => segments.length >= 2, () => new Error('Invalid file name format.') ), E.map(([folder, ...names]: string[]) => { const name = names.join('/'); return { id: join('/')([folder, name]), folder, name, }; }) )

Defined in src/Folder/index.ts:157

getAttributesFromName :: String -> Either Attributes Error
Type declaration:

▸ (name: string): E.Either‹Error, Omit‹Attributes, "type"››

Parameters:

Name Type
name string

Functions

Const fromMetadata

fromMetadata(metadata: Metadata): Left‹Error› | Right‹object›

Defined in src/Folder/index.ts:180

fromMetadata :: Metadata -> Either

Parameters:

Name Type
metadata Metadata

Returns: Left‹Error› | Right‹object›


Const isFile

isFile(a: unknown): a is File

Defined in src/Folder/index.ts:130

isFile :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is File


Const isFileArray

isFileArray(a: unknown): a is File[]

Defined in src/Folder/index.ts:138

isFileArray :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is File[]


Const isFilesByType

isFilesByType(a: unknown): a is FilesByType

Defined in src/Folder/index.ts:146

isFilesByType :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is FilesByType


Const isFolder

isFolder(a: unknown): a is Folder

Defined in src/Folder/index.ts:57

isFolder -> bool

Parameters:

Name Type
a unknown

Returns: a is Folder


Const isMetadata

isMetadata(a: unknown): a is Metadata

Defined in src/Folder/index.ts:107

isMetadata :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is Metadata


Const make

make(name: string): (Anonymous function)

Defined in src/Folder/index.ts:71

make :: String -> Folder

Parameters:

Name Type
name string

Returns: (Anonymous function)

functional-types"index"

Module: "index"

Index

References

References

F

F:


FT

FT:


L

L:


T

T:


V

V:

functional-types"Label"

Module: "Label"

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

ColorMappings

Ƭ ColorMappings: Record‹string, string›

Defined in src/Label.ts:9

Variables

Const toColorMappings

toColorMappings: function = reduce( (acc: ColorMappings, label: Label) => assoc(label.id, label.color)(acc), {} )

Defined in src/Label.ts:29

toColorMappings :: [Label] -> ColorMappings
Type declaration:

▸ (labels: Label[]): ColorMappings

Parameters:

Name Type
labels Label[]

Functions

Const isLabel

isLabel(a: unknown): a is Label

Defined in src/Label.ts:16

isLabel :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is Label

functional-types"Schema/Arbitraries"

Module: "Schema/Arbitraries"

Index

Variables

Functions

Variables

Const regex

regex: nonEmptyString = nonEmptyString

Defined in src/Schema/Arbitraries.ts:85

Functions

Const fileMatcher

fileMatcher(): Arbitrary‹FileMatcher

Defined in src/Schema/Arbitraries.ts:100

Returns: Arbitrary‹FileMatcher


Const fileType

fileType(): Arbitrary‹Type

Defined in src/Schema/Arbitraries.ts:75

Returns: Arbitrary‹Type


Const gettable

gettable(): Arbitrary‹Gettable

Defined in src/Schema/Arbitraries.ts:105

Returns: Arbitrary‹Gettable


Const gettables

gettables(): Arbitrary‹Record‹string, Gettable››

Defined in src/Schema/Arbitraries.ts:112

Returns: Arbitrary‹Record‹string, Gettable››


Const invalidGettableObject

invalidGettableObject(): Arbitrary‹Dictionary‹unknown››

Defined in src/Schema/Arbitraries.ts:40

Returns: Arbitrary‹Dictionary‹unknown››


Const invalidMatcherObject

invalidMatcherObject(): Arbitrary‹Dictionary‹unknown››

Defined in src/Schema/Arbitraries.ts:20

Returns: Arbitrary‹Dictionary‹unknown››


Const invalidSchemaObject

invalidSchemaObject(): Arbitrary‹Dictionary‹unknown››

Defined in src/Schema/Arbitraries.ts:60

Returns: Arbitrary‹Dictionary‹unknown››


Const matcher

matcher(): Arbitrary‹Matcher

Defined in src/Schema/Arbitraries.ts:87

Returns: Arbitrary‹Matcher


Const nonEmptyString

nonEmptyString(): Arbitrary‹string›

Defined in src/Schema/Arbitraries.ts:12

Returns: Arbitrary‹string›


Const nonGettableObject

nonGettableObject(): Arbitrary‹unknown›

Defined in src/Schema/Arbitraries.ts:53

Returns: Arbitrary‹unknown›


Const nonMatcherObject

nonMatcherObject(): Arbitrary‹unknown›

Defined in src/Schema/Arbitraries.ts:29

Returns: Arbitrary‹unknown›


Const nonNumber

nonNumber(): Arbitrary‹unknown›

Defined in src/Schema/Arbitraries.ts:17

Returns: Arbitrary‹unknown›


Const nonSchemaObject

nonSchemaObject(): Arbitrary‹unknown›

Defined in src/Schema/Arbitraries.ts:68

Returns: Arbitrary‹unknown›


Const nonString

nonString(): Arbitrary‹unknown›

Defined in src/Schema/Arbitraries.ts:14

Returns: Arbitrary‹unknown›


Const schema

schema(): Arbitrary‹Schema

Defined in src/Schema/Arbitraries.ts:122

Returns: Arbitrary‹Schema


Const singletonFileMatcher

singletonFileMatcher(): Arbitrary‹FileMatcher

Defined in src/Schema/Arbitraries.ts:94

Returns: Arbitrary‹FileMatcher


Const versionedSchema

versionedSchema(): Arbitrary‹VersionedSchema

Defined in src/Schema/Arbitraries.ts:130

Returns: Arbitrary‹VersionedSchema

functional-types"Schema/index"

Module: "Schema/index"

Index

Interfaces

Type aliases

Functions

Type aliases

Dictionary

Ƭ Dictionary: Record‹string, A›

Defined in src/Schema/index.ts:21


Gettables

Ƭ Gettables: DictionaryGettable

Defined in src/Schema/index.ts:39


Type

Ƭ Type: "pdf" | "excel" | "json" | "pdf-region" | "excel-sheet" | "json-child"

Defined in src/Schema/index.ts:13

Functions

Const isGettable

isGettable(a: unknown): a is Gettable

Defined in src/Schema/index.ts:70

isGettable -> bool

Parameters:

Name Type
a unknown

Returns: a is Gettable


Const isGettables

isGettables(a: unknown): a is Gettables

Defined in src/Schema/index.ts:82

isGettables -> bool

Parameters:

Name Type
a unknown

Returns: a is Gettables


Const isMatcher

isMatcher(a: unknown): a is Matcher

Defined in src/Schema/index.ts:57

isMatcher -> bool

Parameters:

Name Type
a unknown

Returns: a is Matcher


Const isSchema

isSchema(a: unknown): a is Schema

Defined in src/Schema/index.ts:90

isSchema -> bool

Parameters:

Name Type
a unknown

Returns: a is Schema


Const isVersionedSchema

isVersionedSchema(a: unknown): a is VersionedSchema

Defined in src/Schema/index.ts:130

isVersionedSchema :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is VersionedSchema


Const makeSchema

makeSchema(gettables: object): object

Defined in src/Schema/index.ts:102

makeSchema :: Gettables -> Schema

Parameters:

Name Type
gettables object

Returns: object

  • created_at: Date = date

  • gettables(): object

  • id: string = getRandomId()

  • updated_at: Date = date


Const toVersionedSchema

toVersionedSchema(schema: Schema): object

Defined in src/Schema/index.ts:117

toVersionedSchema :: Schema -> VersionedSchema

Parameters:

Name Type
schema Schema

Returns: object

  • id: string = getRandomId()

  • schema_id: string = schema.id

functional-types"String"

Module: "String"

Index

Variables

Variables

Const getRandomId

getRandomId: IO‹string› = uuid

Defined in src/String.ts:9

getRandomId: IO String

functional-types"TableAnnotation"

Module: "TableAnnotation"

Index

Interfaces

Type aliases

Functions

Type aliases

BoundingBoxes

Ƭ BoundingBoxes: Dictionary‹WithHeaderLabeledBoundingBox› | LabeledBoundingBox

Defined in src/TableAnnotation.ts:15


BoundingBoxesByPage

Ƭ BoundingBoxesByPage: BoundingBoxes[]

Defined in src/TableAnnotation.ts:19


TableAnnotationBase

Ƭ TableAnnotationBase: Pick‹TableAnnotation, "file" | "boundingBoxesByPage"›

Defined in src/TableAnnotation.ts:29

Functions

Const isBoundingBoxes

isBoundingBoxes(a: unknown): a is BoundingBoxes

Defined in src/TableAnnotation.ts:39

isBoundingBoxes :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is BoundingBoxes


Const isBoundingBoxesByPage

isBoundingBoxesByPage(a: unknown): a is BoundingBoxesByPage

Defined in src/TableAnnotation.ts:50

isBoundingBoxesByPage :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is BoundingBoxesByPage


Const isTableAnnotation

isTableAnnotation(a: unknown): a is TableAnnotation

Defined in src/TableAnnotation.ts:70

isTableAnnotation :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is TableAnnotation


Const isTableAnnotationBase

isTableAnnotationBase(a: unknown): a is TableAnnotationBase

Defined in src/TableAnnotation.ts:58

isTableAnnotationBase :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is TableAnnotationBase


Const make

make(__namedParameters: object): (Anonymous function)

Defined in src/TableAnnotation.ts:85

make :: (String, BoundingBoxesByPage) -> IO TableAnnotation

Parameters:

__namedParameters: object

Name Type
boundingBoxesByPage Dictionary‹LabeledBoundingBox | LabeledBoundingBox & object | LabeledBoundingBox & object›[]
file string

Returns: (Anonymous function)

functional-types"Vertex/Arbitraries"

Module: "Vertex/Arbitraries"

Index

Functions

Functions

Const boundingBox

boundingBox(): Arbitrary‹BoundingBox

Defined in src/Vertex/Arbitraries.ts:31

Returns: Arbitrary‹BoundingBox


Const nonIntersectingPolygons

nonIntersectingPolygons(): Arbitrary‹[Poly, Poly]›

Defined in src/Vertex/Arbitraries.ts:24

Returns: Arbitrary‹[Poly, Poly]›


Const poly

poly(): Arbitrary‹Poly

Defined in src/Vertex/Arbitraries.ts:21

Returns: Arbitrary‹Poly


Const vertex

vertex(): Arbitrary‹Vertex

Defined in src/Vertex/Arbitraries.ts:15

Returns: Arbitrary‹Vertex


Const withHeaderArguments

withHeaderArguments(): Arbitrary‹object›

Defined in src/Vertex/Arbitraries.ts:43

Returns: Arbitrary‹object›

functional-types"Vertex/index"

Module: "Vertex/index"

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

Line

Ƭ Line: [Vertex, Vertex]

Defined in src/Vertex/index.ts:42


Poly

Ƭ Poly: [Vertex, Vertex, Vertex, Vertex]

Defined in src/Vertex/index.ts:47

[TopLeft, TopRight, BottomLeft, BottomRight]


WithHeader

Ƭ WithHeader: WithHeaderRow‹A› | WithHeaderColumn‹A›

Defined in src/Vertex/index.ts:63


WithHeaderColumn

Ƭ WithHeaderColumn: A & object

Defined in src/Vertex/index.ts:59


WithHeaderRow

Ƭ WithHeaderRow: A & object

Defined in src/Vertex/index.ts:55

Variables

Const areaOf

areaOf: function = converge(multiply, [ widthOf, heightOf, ])

Defined in src/Vertex/index.ts:528

areaOf :: Poly -> Float
Type declaration:

▸ (poly: Poly): number

Parameters:

Name Type
poly Poly

Const getBottomLeft

getBottomLeft: function = nth(2)

Defined in src/Vertex/index.ts:402

getBottomLeft :: Poly -> Vertex
Type declaration:

▸ (poly: Poly): Vertex

Parameters:

Name Type
poly Poly

Const getBottomRight

getBottomRight: function = nth(3)

Defined in src/Vertex/index.ts:409

getBottomRight :: Poly -> Vertex
Type declaration:

▸ (poly: Poly): Vertex

Parameters:

Name Type
poly Poly

Const getCornersFromPoly

getCornersFromPoly: function = applySpec({ start: head, end: last, })

Defined in src/Vertex/index.ts:251

getCornersFromPoly :: Poly -> Corners
Type declaration:

▸ (poly: Poly): Corners

Parameters:

Name Type
poly Poly

Const getTopLeft

getTopLeft: function = nth(0)

Defined in src/Vertex/index.ts:388

getTopLeft :: Poly -> Vertex
Type declaration:

▸ (poly: Poly): Vertex

Parameters:

Name Type
poly Poly

Const getTopRight

getTopRight: function = nth(1)

Defined in src/Vertex/index.ts:395

getTopRight :: Poly -> Vertex
Type declaration:

▸ (poly: Poly): Vertex

Parameters:

Name Type
poly Poly

Const getX

getX: function = pipe(head, prop<'x', number>('x'))

Defined in src/Vertex/index.ts:319

getX :: Line -> Float
Type declaration:

▸ (line: Line): number

Parameters:

Name Type
line Line

Const getXs

getXs: function = map(getX)

Defined in src/Vertex/index.ts:333

getXs :: [Line] -> [Float]
Type declaration:

▸ (lines: Line[]): number[]

Parameters:

Name Type
lines Line[]

Const getY

getY: function = pipe(head, prop<'y', number>('y'))

Defined in src/Vertex/index.ts:312

getY :: Line -> Float
Type declaration:

▸ (line: Line): number

Parameters:

Name Type
line Line

Const getYs

getYs: function = map(getY)

Defined in src/Vertex/index.ts:326

getYs :: [Line] -> [Float]
Type declaration:

▸ (lines: Line[]): number[]

Parameters:

Name Type
lines Line[]

Const heightOf

heightOf: function = converge(subtract, [ pipe(getBottomLeft, prop('y')), pipe(getTopLeft, prop('y')), ])

Defined in src/Vertex/index.ts:518

heightOf :: Poly -> Float
Type declaration:

▸ (poly: Poly): number

Parameters:

Name Type
poly Poly

Const widthOf

widthOf: function = converge(subtract, [ pipe(getTopRight, prop('x')), pipe(getTopLeft, prop('x')), ])

Defined in src/Vertex/index.ts:508

widthOf :: Poly -> Float
Type declaration:

▸ (poly: Poly): number

Parameters:

Name Type
poly Poly

Functions

Const append

append<**A**>(boundingBox: A): (Anonymous function)

Defined in src/Vertex/index.ts:371

append :: BoundingBox -> ([Float], [Float]) -> BoundingBox

Type parameters:

A: BoundingBox

Parameters:

Name Type
boundingBox A

Returns: (Anonymous function)


Const containedBy

containedBy(p0: Poly): function

Defined in src/Vertex/index.ts:599

containedBy :: Poly -> Reader Poly Float

Parameters:

Name Type
p0 Poly

Returns: function

▸ (...a: keyof any[]): any

Parameters:

Name Type
...a keyof any[]

Const contains

contains(p0: Poly): (Anonymous function)

Defined in src/Vertex/index.ts:613

contains :: Poly -> Reader Poly Float

Parameters:

Name Type
p0 Poly

Returns: (Anonymous function)


Const hasHeader

hasHeader<**A**>(a: A): a is WithHeader

Defined in src/Vertex/index.ts:159

hasHeader :: a -> bool

Type parameters:

A: BoundingBox

Parameters:

Name Type
a A

Returns: a is WithHeader


Const hasHeaderColumn

hasHeaderColumn<**A**>(a: A): a is WithHeaderColumn

Defined in src/Vertex/index.ts:150

hasHeaderColumn :: a -> bool

Type parameters:

A: BoundingBox

Parameters:

Name Type
a A

Returns: a is WithHeaderColumn


Const hasHeaderRow

hasHeaderRow<**A**>(a: A): a is WithHeaderRow

Defined in src/Vertex/index.ts:141

hasHeaderRow :: a -> bool

Type parameters:

A: BoundingBox

Parameters:

Name Type
a A

Returns: a is WithHeaderRow


Const intersects

intersects(p0: Poly): (Anonymous function)

Defined in src/Vertex/index.ts:573

intersects :: Poly -> Reader Poly Poly

Parameters:

Name Type
p0 Poly

Returns: (Anonymous function)


Const isBoundingBox

isBoundingBox(a: unknown): a is BoundingBox

Defined in src/Vertex/index.ts:129

isBoundingBox :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is BoundingBox


Const isLabeledBoundingBox

isLabeledBoundingBox(a: unknown): a is LabeledBoundingBox

Defined in src/Vertex/index.ts:340

isLabeledBoundingBox :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is LabeledBoundingBox


Const isLine

isLine(a: unknown): a is Line

Defined in src/Vertex/index.ts:97

isLine :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is Line


Const isPoly

isPoly(a: unknown): a is Poly

Defined in src/Vertex/index.ts:109

isPoly :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is Poly


Const isVertex

isVertex(a: unknown): a is Vertex

Defined in src/Vertex/index.ts:89

isVertex :: a -> bool

Parameters:

Name Type
a unknown

Returns: a is Vertex


Const lengthOf

lengthOf(__namedParameters: [any, any]): number

Defined in src/Vertex/index.ts:538

lengthOf :: Line -> Float

Parameters:

Name Type
__namedParameters [any, any]

Returns: number


Const makeBoundingBox

makeBoundingBox(boundingPoly: Poly, ys: number[], xs: number[]): BoundingBox

Defined in src/Vertex/index.ts:293

makeBoundingBox :: (Poly, [Float], [Float]) -> BoundingBox

Parameters:

Name Type
boundingPoly Poly
ys number[]
xs number[]

Returns: BoundingBox


Const makeLabeledBoundingBox

makeLabeledBoundingBox(id: string, label: string, boundingPoly: Poly, ys: number[], xs: number[]): LabeledBoundingBox

Defined in src/Vertex/index.ts:348

makeLabeledBoundingBox :: (String, String, Poly, [Float], [Float]) -> LabeledBoundingBox

Parameters:

Name Type
id string
label string
boundingPoly Poly
ys number[]
xs number[]

Returns: LabeledBoundingBox


Const makeLine

makeLine(x0: number, y0: number, x1: number, y1: number): Line

Defined in src/Vertex/index.ts:174

makeVertex :: (Float, Float, Float, Float) -> Line

Parameters:

Name Type
x0 number
y0 number
x1 number
y1 number

Returns: Line


Const makePoly

makePoly(...coords: [number, number, number, number]): Poly

Defined in src/Vertex/index.ts:239

makePoly :: (Float, Float, Float, Float) -> Poly

Parameters:

Name Type
...coords [number, number, number, number]

Returns: Poly


Const makeVertex

makeVertex(x: number, y: number): Vertex

Defined in src/Vertex/index.ts:167

makeVertex :: (Float, Float) -> Vertex

Parameters:

Name Type
x number
y number

Returns: Vertex


Const toPoly

toPoly(__namedParameters: object): [Vertex, Vertex, Vertex, Vertex]

Defined in src/Vertex/index.ts:565

toPoly :: Rectangle -> Poly

Parameters:

__namedParameters: object

Name Type
x0 number
x1 number
y0 number
y1 number

Returns: [Vertex, Vertex, Vertex, Vertex]


Const toRectangle

toRectangle(__namedParameters: [Vertex, Vertex, Vertex, Vertex]): object

Defined in src/Vertex/index.ts:548

toRectangle :: Poly -> Rectangle

Parameters:

Name Type
__namedParameters [Vertex, Vertex, Vertex, Vertex]

Returns: object

  • x0: number = topLeft.x

  • x1: number = bottomRight.x

  • y0: number = topRight.y

  • y1: number = bottomLeft.y


Const withHeader

withHeader(vertex: Vertex): (Anonymous function)

Defined in src/Vertex/index.ts:493

withHeader :: Vertex -> ReaderEither BoundingBox (WithHeader BoundingBox) BoundingBox

Parameters:

Name Type
vertex Vertex

Returns: (Anonymous function)


Const withHeaderColumn

withHeaderColumn(x: number): (Anonymous function)

Defined in src/Vertex/index.ts:456

withHeaderColumn :: Float -> ReaderEither BoundingBox BoundingBox (WithHeaderColumn BoundingBox)

Parameters:

Name Type
x number

Returns: (Anonymous function)


Const withHeaderRow

withHeaderRow(y: number): (Anonymous function)

Defined in src/Vertex/index.ts:418

withHeaderRow :: Float -> ReaderEither BoundingBox BoundingBox (WithHeaderRow BoundingBox)

Parameters:

Name Type
y number

Returns: (Anonymous function)