Skip to content

Commit

Permalink
Export private types
Browse files Browse the repository at this point in the history
Closes #1830
  • Loading branch information
remcohaszing committed Apr 14, 2023
1 parent 4ac9d6b commit f3f4b6c
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 139 deletions.
62 changes: 31 additions & 31 deletions lib/at-rule.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
import Container, { ContainerProps } from './container.js'

interface AtRuleRaws extends Record<string, unknown> {
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string
declare namespace AtRule {
export interface AtRuleRaws extends Record<string, unknown> {
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string

/**
* The space symbols after the last child of the node to the end of the node.
*/
after?: string
/**
* The space symbols after the last child of the node to the end of the node.
*/
after?: string

/**
* The space between the at-rule name and its parameters.
*/
afterName?: string
/**
* The space between the at-rule name and its parameters.
*/
afterName?: string

/**
* The symbols between the last parameter and `{` for rules.
*/
between?: string
/**
* The symbols between the last parameter and `{` for rules.
*/
between?: string

/**
* Contains `true` if the last child has an (optional) semicolon.
*/
semicolon?: boolean
/**
* Contains `true` if the last child has an (optional) semicolon.
*/
semicolon?: boolean

/**
* The rule’s selector with comments.
*/
params?: {
value: string
raw: string
/**
* The rule’s selector with comments.
*/
params?: {
value: string
raw: string
}
}
}

declare namespace AtRule {
export interface AtRuleProps extends ContainerProps {
/** Name of the at-rule. */
name: string
Expand Down Expand Up @@ -79,7 +79,7 @@ declare namespace AtRule {
declare class AtRule_ extends Container {
type: 'atrule'
parent: Container | undefined
raws: AtRuleRaws
raws: AtRule.AtRuleRaws

/**
* The at-rule’s name immediately follows the `@`.
Expand Down
32 changes: 16 additions & 16 deletions lib/comment.d.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import Container from './container.js'
import Node, { NodeProps } from './node.js'

interface CommentRaws extends Record<string, unknown> {
/**
* The space symbols before the node.
*/
before?: string
declare namespace Comment {
export interface CommentRaws extends Record<string, unknown> {
/**
* The space symbols before the node.
*/
before?: string

/**
* The space symbols between `/*` and the comment’s text.
*/
left?: string
/**
* The space symbols between `/*` and the comment’s text.
*/
left?: string

/**
* The space symbols between the comment’s text.
*/
right?: string
}
/**
* The space symbols between the comment’s text.
*/
right?: string
}

declare namespace Comment {
export interface CommentProps extends NodeProps {
/** Content of the comment. */
text: string
Expand Down Expand Up @@ -47,7 +47,7 @@ declare namespace Comment {
declare class Comment_ extends Node {
type: 'comment'
parent: Container | undefined
raws: CommentRaws
raws: Comment.CommentRaws

/**
* The comment's text.
Expand Down
24 changes: 12 additions & 12 deletions lib/container.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import Comment from './comment.js'
import AtRule from './at-rule.js'
import Rule from './rule.js'

interface ValueOptions {
/**
* An array of property names.
*/
props?: string[]
declare namespace Container {
export interface ValueOptions {
/**
* An array of property names.
*/
props?: string[]

/**
* String that’s used to narrow down values and speed up the regexp search.
*/
fast?: string
}
/**
* String that’s used to narrow down values and speed up the regexp search.
*/
fast?: string
}

declare namespace Container {
export interface ContainerProps extends NodeProps {
nodes?: (ChildNode | ChildProps)[]
}
Expand Down Expand Up @@ -396,7 +396,7 @@ declare abstract class Container_<
*/
replaceValues(
pattern: string | RegExp,
options: ValueOptions,
options: Container.ValueOptions,
replaced: string | { (substring: string, ...args: any[]): string }
): this
replaceValues(
Expand Down
46 changes: 23 additions & 23 deletions lib/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import Container from './container.js'
import Node from './node.js'

interface DeclarationRaws extends Record<string, unknown> {
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string
declare namespace Declaration {
export interface DeclarationRaws extends Record<string, unknown> {
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string

/**
* The symbols between the property and value for declarations.
*/
between?: string
/**
* The symbols between the property and value for declarations.
*/
between?: string

/**
* The content of the important statement, if it is not just `!important`.
*/
important?: string
/**
* The content of the important statement, if it is not just `!important`.
*/
important?: string

/**
* Declaration value with comments.
*/
value?: {
value: string
raw: string
/**
* Declaration value with comments.
*/
value?: {
value: string
raw: string
}
}
}

declare namespace Declaration {
export interface DeclarationProps {
/** Name of the declaration. */
prop: string
Expand Down Expand Up @@ -66,7 +66,7 @@ declare class Declaration_ extends Node {

type: 'decl'
parent: Container | undefined
raws: DeclarationRaws
raws: Declaration.DeclarationRaws

/**
* The declaration's property name.
Expand Down
52 changes: 26 additions & 26 deletions lib/root.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ import Document from './document.js'
import { ProcessOptions } from './postcss.js'
import Result from './result.js'

interface RootRaws extends Record<string, any> {
/**
* The space symbols after the last child to the end of file.
*/
after?: string
declare namespace Root {
export interface RootRaws extends Record<string, any> {
/**
* The space symbols after the last child to the end of file.
*/
after?: string

/**
* Non-CSS code before `Root`, when `Root` is inside `Document`.
*
* **Experimental:** some aspects of this node could change within minor
* or patch version releases.
*/
codeBefore?: string
/**
* Non-CSS code before `Root`, when `Root` is inside `Document`.
*
* **Experimental:** some aspects of this node could change within minor
* or patch version releases.
*/
codeBefore?: string

/**
* Non-CSS code after `Root`, when `Root` is inside `Document`.
*
* **Experimental:** some aspects of this node could change within minor
* or patch version releases.
*/
codeAfter?: string
/**
* Non-CSS code after `Root`, when `Root` is inside `Document`.
*
* **Experimental:** some aspects of this node could change within minor
* or patch version releases.
*/
codeAfter?: string

/**
* Is the last child has an (optional) semicolon.
*/
semicolon?: boolean
}
/**
* Is the last child has an (optional) semicolon.
*/
semicolon?: boolean
}

declare namespace Root {
export interface RootProps extends ContainerProps {
/**
* Information used to generate byte-to-byte equal node string
Expand All @@ -58,7 +58,7 @@ declare class Root_ extends Container {
constructor(defaults?: Root.RootProps)
type: 'root'
parent: Document | undefined
raws: RootRaws
raws: Root.RootRaws

/**
* Returns a `Result` instance representing the root’s CSS.
Expand Down
62 changes: 31 additions & 31 deletions lib/rule.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
import Container, { ContainerProps } from './container.js'

interface RuleRaws extends Record<string, unknown> {
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string
declare namespace Rule {
export interface RuleRaws extends Record<string, unknown> {
/**
* The space symbols before the node. It also stores `*`
* and `_` symbols before the declaration (IE hack).
*/
before?: string

/**
* The space symbols after the last child of the node to the end of the node.
*/
after?: string
/**
* The space symbols after the last child of the node to the end of the node.
*/
after?: string

/**
* The symbols between the selector and `{` for rules.
*/
between?: string
/**
* The symbols between the selector and `{` for rules.
*/
between?: string

/**
* Contains `true` if the last child has an (optional) semicolon.
*/
semicolon?: boolean
/**
* Contains `true` if the last child has an (optional) semicolon.
*/
semicolon?: boolean

/**
* Contains `true` if there is semicolon after rule.
*/
ownSemicolon?: string
/**
* Contains `true` if there is semicolon after rule.
*/
ownSemicolon?: string

/**
* The rule’s selector with comments.
*/
selector?: {
value: string
raw: string
/**
* The rule’s selector with comments.
*/
selector?: {
value: string
raw: string
}
}
}

declare namespace Rule {
export interface RuleProps extends ContainerProps {
/** Selector or selectors of the rule. */
selector?: string
Expand Down Expand Up @@ -73,7 +73,7 @@ declare class Rule_ extends Container {
constructor(defaults?: Rule.RuleProps)
type: 'rule'
parent: Container | undefined
raws: RuleRaws
raws: Rule.RuleRaws

/**
* The rule’s full selector represented as a string.
Expand Down

0 comments on commit f3f4b6c

Please sign in to comment.