Skip to content

Commit 6060d1d

Browse files
authored
Docs(positioner): update type comments (getPosition) (segmentio#883)
1 parent 78daaf4 commit 6060d1d

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/positioner/src/getPosition.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ const getTransformOrigin = ({ rect, position, dimensions, targetCenter }) => {
156156
* Function that takes in numbers and position and gives the final coords.
157157
* @param {Position} position — the position the positioner should be on.
158158
* @param {Object} dimensions — the dimensions of the positioner.
159-
* @param {Object} targetRect — the rect of the target.
159+
* @param {Rect} targetRect — the rect of the target.
160160
* @param {Number} targetOffset - offset from the target.
161161
* @param {Object} viewport - the width and height of the viewport.
162-
* @param {Object} viewportOffset - offset from the viewport.
163-
* @return {Object} - { x: Number, y: Number }
162+
* @param {Number} viewportOffset - offset from the viewport.
163+
* @return {Object} - { rect: Rect, position: Position, transformOrigin: string }
164164
*/
165165
export default function getFittedPosition({
166166
position,
@@ -227,7 +227,7 @@ export default function getFittedPosition({
227227
* Function that takes in numbers and position and gives the final coords.
228228
* @param {Position} position — the position the positioner should be on.
229229
* @param {Object} dimensions — the dimensions of the positioner.
230-
* @param {Object} targetRect — the rect of the target.
230+
* @param {Rect} targetRect — the rect of the target.
231231
* @param {Number} targetOffset - offset from the target.
232232
* @param {Object} viewport - the width and height of the viewport.
233233
* @param {Object} viewportOffset - offset from the viewport.
@@ -407,11 +407,11 @@ function getPosition({
407407

408408
/**
409409
* Function that takes in numbers and position and gives the final coords.
410-
* @param {Object} position - the width and height of the viewport.
410+
* @param {Position} position
411411
* @param {Number} targetOffset - offset from the target.
412412
* @param {Object} dimensions — the dimensions of the positioner.
413-
* @param {Object} targetRect — the rect of the target.
414-
* @return {Object} - { x: Number, y: Number }
413+
* @param {Rect} targetRect — the rect of the target.
414+
* @return {Rect} - Rect { width, height, left, top, right, bottom }
415415
*/
416416
function getRect({ position, targetOffset, dimensions, targetRect }) {
417417
const leftRect = targetRect.left + targetRect.width / 2 - dimensions.width / 2

src/themer/src/createAppearance.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@ function createAppearance(obj = {}) {
3535
result[key] = obj[key]
3636
} else if (isDev) {
3737
console.error(
38-
`createAppearance() only accepts strings as properties, key '${key}' with value '${
39-
obj[key]
40-
}' is not a string`
38+
`createAppearance() only accepts strings as properties, key '${key}' with value '${obj[key]}' is not a string`
4139
)
4240
}
4341
} else if (isDev) {

0 commit comments

Comments
 (0)