Skip to content
Merged
3 changes: 3 additions & 0 deletions packages/svelte/src/compiler/compile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ function validate_options(options, warnings) {
}

/**
* `compile` takes your component source code, and turns it into a JavaScript module that exports a class.
*
* https://svelte.dev/docs/svelte-compiler#svelte-compile
* @param {string} source
* @param {import('../interfaces.js').CompileOptions} options
*/
Expand Down
3 changes: 3 additions & 0 deletions packages/svelte/src/compiler/parse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,9 @@ export class Parser {
}

/**
* The parse function parses a component, returning only its abstract syntax tree.
*
* https://svelte.dev/docs/svelte-compiler#svelte-parse
* @param {string} template
* @param {import('../interfaces.js').ParserOptions} options
* @returns {import('../interfaces.js').Ast}
Expand Down
4 changes: 4 additions & 0 deletions packages/svelte/src/compiler/preprocess/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ async function process_markup(process, source) {
}

/**
* The preprocess function provides convenient hooks for arbitrarily transforming component source code.
* For example, it can be used to convert a <style lang="sass"> block into vanilla CSS.
*
* https://svelte.dev/docs/svelte-compiler#svelte-preprocess
* @param {string} source
* @param {import('./public.js').PreprocessorGroup | import('./public.js').PreprocessorGroup[]} preprocessor
* @param {{ filename?: string }} [options]
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/compiler/utils/namespaces.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// The `foreign` namespace covers all DOM implementations that aren't HTML5.
// It opts out of HTML5-specific a11y checks and case-insensitive attribute names.
export const foreign = 'https://svelte.dev/docs#template-syntax-svelte-options';
export const foreign = 'https://svelte.dev/docs/special-elements#svelte-options';
export const html = 'http://www.w3.org/1999/xhtml';
export const mathml = 'http://www.w3.org/1998/Math/MathML';
export const svg = 'http://www.w3.org/2000/svg';
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte/src/runtime/action/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* }
* ```
*
* Docs: https://svelte.dev/docs#template-syntax-element-directives-use-action
* Docs: https://svelte.dev/docs/svelte-action
*/
export interface ActionReturn<
Parameter = never,
Expand Down Expand Up @@ -55,7 +55,7 @@ export interface ActionReturn<
* You can return an object with methods `update` and `destroy` from the function and type which additional attributes and events it has.
* See interface `ActionReturn` for more details.
*
* Docs: https://svelte.dev/docs#template-syntax-element-directives-use-action
* Docs: https://svelte.dev/docs/svelte-action
*/
export interface Action<
Element = HTMLElement,
Expand Down
4 changes: 4 additions & 0 deletions packages/svelte/src/runtime/animate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { cubicOut } from '../easing/index.js';
import { is_function } from '../internal/index.js';

/**
* The flip function calculates the start and end position of an element and animates between them, translating the x and y values.
* `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).
*
* https://svelte.dev/docs/svelte-animate#flip
* @param {Element} node
* @param {{ from: DOMRect; to: DOMRect }} fromTo
* @param {import('./public.js').FlipParams} params
Expand Down
30 changes: 30 additions & 0 deletions packages/svelte/src/runtime/easing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Distributed under MIT License https://github.com/mattdesl/eases/blob/master/LICE
export { identity as linear } from '../internal/index.js';

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -15,6 +16,7 @@ export function backInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -24,6 +26,7 @@ export function backIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -33,6 +36,7 @@ export function backOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -54,6 +58,7 @@ export function bounceOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -62,6 +67,7 @@ export function bounceInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -70,6 +76,7 @@ export function bounceIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -79,6 +86,7 @@ export function circInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -87,6 +95,7 @@ export function circIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -95,6 +104,7 @@ export function circOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -103,6 +113,7 @@ export function cubicInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -111,6 +122,7 @@ export function cubicIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -120,6 +132,7 @@ export function cubicOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -133,6 +146,7 @@ export function elasticInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -141,6 +155,7 @@ export function elasticIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -149,6 +164,7 @@ export function elasticOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -161,6 +177,7 @@ export function expoInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -169,6 +186,7 @@ export function expoIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -177,6 +195,7 @@ export function expoOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -188,6 +207,7 @@ export function quadInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -196,6 +216,7 @@ export function quadIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -204,6 +225,7 @@ export function quadOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -212,6 +234,7 @@ export function quartInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -220,6 +243,7 @@ export function quartIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -228,6 +252,7 @@ export function quartOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -237,6 +262,7 @@ export function quintInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -245,6 +271,7 @@ export function quintIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -253,6 +280,7 @@ export function quintOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -261,6 +289,7 @@ export function sineInOut(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand All @@ -271,6 +300,7 @@ export function sineIn(t) {
}

/**
* https://svelte.dev/docs/svelte-easing
* @param {number} t
* @returns {number}
*/
Expand Down
18 changes: 10 additions & 8 deletions packages/svelte/src/runtime/internal/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function get_current_component() {
*
* The first time the callback runs will be before the initial `onMount`
*
* https://svelte.dev/docs#run-time-svelte-beforeupdate
* https://svelte.dev/docs/svelte#beforeupdate
* @param {() => any} fn
* @returns {void}
*/
Expand All @@ -34,7 +34,7 @@ export function beforeUpdate(fn) {
*
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
*
* https://svelte.dev/docs#run-time-svelte-onmount
* https://svelte.dev/docs/svelte#onmount
* @template T
* @param {() => import('./private.js').NotFunction<T> | Promise<import('./private.js').NotFunction<T>> | (() => any)} fn
* @returns {void}
Expand All @@ -47,6 +47,8 @@ export function onMount(fn) {
* Schedules a callback to run immediately after the component has been updated.
*
* The first time the callback runs will be after the initial `onMount`
*
* https://svelte.dev/docs/svelte#afterupdate
* @param {() => any} fn
* @returns {void}
*/
Expand All @@ -60,7 +62,7 @@ export function afterUpdate(fn) {
* Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the
* only one that runs inside a server-side component.
*
* https://svelte.dev/docs#run-time-svelte-ondestroy
* https://svelte.dev/docs/svelte#ondestroy
* @param {() => any} fn
* @returns {void}
*/
Expand All @@ -87,7 +89,7 @@ export function onDestroy(fn) {
* }>();
* ```
*
* https://svelte.dev/docs#run-time-svelte-createeventdispatcher
* https://svelte.dev/docs/svelte#createeventdispatcher
* @template {Record<string, any>} [EventMap=any]
* @returns {import('./public.js').EventDispatcher<EventMap>}
*/
Expand Down Expand Up @@ -115,7 +117,7 @@ export function createEventDispatcher() {
*
* Like lifecycle functions, this must be called during component initialisation.
*
* https://svelte.dev/docs#run-time-svelte-setcontext
* https://svelte.dev/docs/svelte#setcontext
* @template T
* @param {any} key
* @param {T} context
Expand All @@ -130,7 +132,7 @@ export function setContext(key, context) {
* Retrieves the context that belongs to the closest parent component with the specified `key`.
* Must be called during component initialisation.
*
* https://svelte.dev/docs#run-time-svelte-getcontext
* https://svelte.dev/docs/svelte#getcontext
* @template T
* @param {any} key
* @returns {T}
Expand All @@ -144,7 +146,7 @@ export function getContext(key) {
* Must be called during component initialisation. Useful, for example, if you
* programmatically create a component and want to pass the existing context to it.
*
* https://svelte.dev/docs#run-time-svelte-getallcontexts
* https://svelte.dev/docs/svelte#getallcontexts
* @template {Map<any, any>} [T=Map<any, any>]
* @returns {T}
*/
Expand All @@ -156,7 +158,7 @@ export function getAllContexts() {
* Checks whether a given `key` has been set in the context of a parent component.
* Must be called during component initialisation.
*
* https://svelte.dev/docs#run-time-svelte-hascontext
* https://svelte.dev/docs/svelte#hascontext
* @param {any} key
* @returns {boolean}
*/
Expand Down
2 changes: 2 additions & 0 deletions packages/svelte/src/runtime/internal/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ export function subscribe(store, ...callbacks) {

/**
* Get the current value from a store by subscribing and immediately unsubscribing.
*
* https://svelte.dev/docs/svelte-store#get
* @template T
* @param {import('../store/public.js').Readable<T>} store
* @returns {T}
Expand Down
Loading