diff --git a/src/runtime/motion/spring.js b/src/runtime/motion/spring.js index 31d8b660f5..f708241956 100644 --- a/src/runtime/motion/spring.js +++ b/src/runtime/motion/spring.js @@ -1,7 +1,9 @@ -import { writable } from '../store'; -import { loop, now } from '../internal'; -import { is_date } from './utils'; -/** @param {TickContext} ctx +import { writable } from '../store.js'; +import { loop, now } from '../internal.js'; +import { is_date } from './utils.js'; + +/** + * @param {TickContext} ctx * @param {T} last_value * @param {T} current_value * @param {T} target_value @@ -41,7 +43,9 @@ function tick_spring(ctx, last_value, current_value, target_value) { throw new Error(`Cannot spring ${typeof current_value} values`); } } -/** @param {T} value + +/** + * @param {T} value * @param {SpringOpts} opts * @returns {import("/Users/elliottjohnson/dev/sveltejs/svelte/spring.ts-to-jsdoc").Spring} */ @@ -128,22 +132,29 @@ export function spring(value, opts = {}) { * @template T */ -/** @typedef {Object} TickContext +/** + * @typedef {Object} TickContext * @property {number} inv_mass * @property {number} dt * @property {Spring} opts * @property {boolean} settled */ -/** @typedef {Object} SpringOpts + +/** + * @typedef {Object} SpringOpts * @property {number} [stiffness] * @property {number} [damping] * @property {number} [precision] */ -/** @typedef {Object} SpringUpdateOpts + +/** + * @typedef {Object} SpringUpdateOpts * @property {any} [hard] * @property {string|number|boolean} [soft] */ -/** @typedef {Object} Spring + +/** + * @typedef {Object} Spring * @property {(new_value:T,opts?:SpringUpdateOpts)=>Promise} set * @property {(fn:Updater,opts?:SpringUpdateOpts)=>Promise} update * @property {number} precision