Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some typescript definitions #521

Open
efbenson opened this issue Mar 17, 2023 · 0 comments
Open

Add some typescript definitions #521

efbenson opened this issue Mar 17, 2023 · 0 comments
Labels
enhancement LOE: low Level Of Effort: low

Comments

@efbenson
Copy link

efbenson commented Mar 17, 2023

When doing things like creating custom providers it would be nice to have typescript definitions for all the data that is returned through the getData function. In particular the configuration data like meta, relationships etc. With that it would be easier for the developers to know what is required or can be used for different scenarios. Taking away some of the problems away when you can spend only some stuff back but if you don't send enough information back about the dataset you get odd errors that are not easy to debug. Mostly I think the types for the configuration information in Featureserver being the most prominent. I have some examples that I have thrown in my local project to help us along.

  export interface Relationship {
    id: number, // The unique relationship id.
    name: string, // The name of the relationship
    relatedTableId: number, // Id of the layer/table related records are found
    cardinality: string, // esriRelCardinalityOneToMany | esriRelCardinalityManyToMany
    role: string, // esriRelRoleOrigin | esriRelRoleDestination
    keyField: string, // key field name in the related Table
    composite: boolean// likely to false
  }

  export interface Metadata {
    id: number,
    name: string
    description: string
    extent?: number[][]
    displayField?: string
    geometryType?: string
    idField?: string
    maxRecordCount: number
    limitExceeded?: boolean
    fields: Field[]
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement LOE: low Level Of Effort: low
Projects
None yet
Development

No branches or pull requests

2 participants