Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

142
Visualizações
Argument of type 'IResizeHandleSettingsDetail' is not assignable to parameter of type 'IResizeHandleSettings'

Why do these lines

handleSettings: IResizeHandleSettings = {
  right: {
    position: 'right',
    axis: 'x',
    dimension: 'width',
    eventProperty: 'clientX',
    translate: false,
    deltaMultiplier: 1,
  },
  left: {
    position: 'left',
    axis: 'x',
    dimension: 'width',
    eventProperty: 'clientX',
    translate: true,
    deltaMultiplier: -1,
  },
  bottom: {
    position: 'bottom',
    axis: 'y',
    dimension: 'height',
    eventProperty: 'clientY',
    translate: false,
    deltaMultiplier: 1,
  },
  top: {
    position: 'top',
    axis: 'y',
    dimension: 'height',
    eventProperty: 'clientY',
    translate: true,
    deltaMultiplier: -1,
  },
};

selectedHandleSettings: {
  x: string | undefined | null;
  y: string | undefined | null;
  settings: IResizeHandleSettings[];
};

method(positionKey: string) {
  this.selectedHandleSettings.settings.push(this.handleSettings[positionKey]);
}

throw the error

S2345: Argument of type 'IResizeHandleSettingsDetail' is not assignable to parameter of type 'IResizeHandleSettings'.   Type 'IResizeHandleSettingsDetail' is missing the following properties from type 'IResizeHandleSettings': left, right, top, bottom

even though my type is defined with the index signature as follows

export interface IResizeHandleSettings {
  [key: string]: IResizeHandleSettingsDetail;
  left: IResizeHandleSettingsDetail;
  right: IResizeHandleSettingsDetail;
  top: IResizeHandleSettingsDetail;
  bottom: IResizeHandleSettingsDetail;
}

export interface IResizeHandleSettingsDetail {
  position: string;
  axis: string;
  dimension: string;
  eventProperty: string;
  translate: boolean;
  deltaMultiplier: number;
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

this.handleSettings[positionKey] refers to a IResizeHandleSettingsDetail, so you need to set up selectedHandleSettings accordingly:

selectedHandleSettings: {
  x: string | undefined | null;
  y: string | undefined | null;
  settings: IResizeHandleSettingsDetail[]; // <-- ...Detail!
};
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda