import * as postcss from 'postcss'; import { AnyExpression, ExpressionProps } from './expression'; import { Node, NodeProps } from './node'; import { ParameterList } from './parameter-list'; import * as sassInternal from './sass-internal'; import { RawWithValue } from './raw-with-value'; /** * The set of raws supported by {@link Parameter}. * * @category Statement */ export interface ParameterRaws { /** The whitespace before the parameter name. */ before?: string; /** * The parameter's name, not including the `$`. * * This may be different than {@link Parameter.name} if the name contains * escape codes or underscores. */ name?: RawWithValue; /** * The whitespace and colon between the parameter name and default value, if * it has one. */ between?: string; /** * The whitespace between the parameter name and the `...`, if {@link * Parameter.rest} is true. */ beforeRest?: string; /** * The space symbols between the end of the parameter (after the default value * if it has one or the parameter name if it doesn't) and the comma afterwards. * Always empty for a parameter that doesn't have a trailing comma. */ after?: string; } /** * The initializer properties for {@link Parameter} passed as an * options object. * * @category Statement */ export type ParameterObjectProps = NodeProps & { raws?: ParameterRaws; name: string; } & ({ defaultValue?: AnyExpression | ExpressionProps; rest?: never; } | { defaultValue?: never; rest?: boolean; }); /** * Properties used to initialize a {@link Parameter} without an explicit name. * This is used when the name is given elsewhere, either in the array form of * {@link ParameterProps} or the record form of [@link * ParameterDeclarationProps}. */ export type ParameterExpressionProps = AnyExpression | ExpressionProps | Omit; /** * The initializer properties for {@link Parameter}. * * @category Statement */ export type ParameterProps = ParameterObjectProps | string | [string, ParameterExpressionProps]; /** * A single parameter defined in the parameter declaration of a `@mixin` or * `@function` rule. This is always included in a {@link ParameterList}. * * @category Statement */ export declare class Parameter extends Node { readonly sassType: "parameter"; raws: ParameterRaws; parent: ParameterList | undefined; /** * The parameter name, not including `$`. * * This is the parsed and normalized value, with underscores converted to * hyphens and escapes resolved to the characters they represent. */ name: string; /** * The expression that provides the default value for the parameter. * * Setting this to a value automatically sets {@link rest} to `false`. */ get defaultValue(): AnyExpression | undefined; set defaultValue(value: AnyExpression | ExpressionProps | undefined); private _defaultValue?; /** * Whether this is a rest parameter (indicated by `...` in Sass). * * Setting this to true automatically sets {@link defaultValue} to * `undefined`. */ get rest(): boolean; set rest(value: boolean); private _rest?; constructor(defaults: ParameterProps); /** @hidden */ constructor(_: undefined, inner: sassInternal.Parameter); clone(overrides?: Partial): this; toJSON(): object; /** @hidden */ toJSON(_: string, inputs: Map): object; /** @hidden */ toString(): string; /** @hidden */ get nonStatementChildren(): ReadonlyArray; }