import type Point from "../../geometry/Point.js";

/** Defines the sublayer structure and the named types that will be in the KnowledgeGraphLayer */
export interface InclusionListDefinition {
  /**
   * Specifies whether to create sublayers for each [named type](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html)
   * regardless of whether or not they are included in the `namedTypeDefinition`. If `true` all named types ([EntityType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html) and
   * [RelationshipType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html)) will be added as an empty sublayer.
   */
  generateAllSublayers: boolean;
  /**
   * A map of named types and the specific instances
   * of those types to include in the layer.
   */
  namedTypeDefinitions: Map<string, LayerInclusionDefinition>;
}

/** Defines the contents of each specified named type in the [KnowledgeGraphLayer#inclusionModeDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#inclusionModeDefinition) and whether all instance of the named type will be used or a specified subset. */
export interface LayerInclusionDefinition {
  /**
   * A map of the specific members of the named type to be included.
   * The key is the global ID of the instance.
   */
  members?: Map<string, LayerInclusionMemberDefinition>;
  /**
   * If `true` all of the instances of the named type will be included regardless of if there is a defined list of members.
   * If `false` only the instances specified in the `members` property will be included.
   */
  useAllData: boolean;
}

/** Defines the list of `members` for a named type in the [KnowledgeGraphLayer#inclusionModeDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-KnowledgeGraphLayer.html#inclusionModeDefinition). */
export interface LayerInclusionMemberDefinition {
  /** The global ID of the specific instance of the named type to be included in the layer. */
  id: string;
}

/** Defines the sublayer structure and the named types that will be in the LinkChartLayer. */
export interface InclusionListDefinitionConstructor {
  /**
   * Specifies whether to create sublayers for each [named type](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html)
   * regardless of whether or not they are included in the `namedTypeDefinition`. If `true` all named types ([EntityType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html) and
   * [RelationshipType](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html)) will be added as an empty sublayer.
   */
  generateAllSublayers: boolean;
  /**
   * A map of named types and the specific instances
   * of those types to include in the layer.
   */
  namedTypeDefinitions: Map<string, LayerInclusionDefinitionConstructor>;
}

/** Defines the contents of each specified named type in the [LinkChartLayer#initializationInclusionModeDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#initializationInclusionModeDefinition) and whether all instance of the named type will be used or a specified subset. */
export interface LayerInclusionDefinitionConstructor {
  /**
   * A map of the specific members of the named type to be included.
   * The key is the global ID of the instance.
   */
  members?: Map<string, LayerInclusionMemberDefinitionConstructor>;
  /**
   * If `true` all of the instances of the named type will be included regardless of if there is a defined list of members.
   * If `false` only the instances specified in the `members` property will be included.
   */
  useAllData: boolean;
}

/** Defines the list of `members` for a named type in the [LinkChartLayer#initializationInclusionModeDefinition](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-LinkChartLayer.html#initializationInclusionModeDefinition). */
export interface LayerInclusionMemberDefinitionConstructor {
  /** The global ID of the specific instance of the named type to be included in the layer. */
  id: string;
  /** The exact point location of the entity on the LinkChart. */
  linkChartLocation?: Point;
}