Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

140
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!