@eagleoutice/flowr - v2.15.8
    Preparing search index...

    Variable PlaygroundConst

    Playground: {
        BaseRef: string;
        Box: typeof PlaygroundBox;
        hash(this: void, fields: readonly (readonly [string, string])[]): string;
        link(this: void, parts: PlaygroundLinkParts): string;
        Mark: {
            compress(
                this: void,
                marks: readonly PlaygroundMark[],
            ): PlaygroundMark[];
            expand(this: void, marks: readonly string[]): PlaygroundMark[];
            isValid(this: void, mark: unknown): mark is PlaygroundMark;
        };
        name: string;
        nameIndexIn(this: void, text: string, name: string): number | undefined;
        packConfig(this: void, config: readonly string[]): string;
        positionOf(this: void, code: string, criterion: string): string | undefined;
        reportLink(
            this: void,
            code: string,
            parts?: Omit<PlaygroundLinkParts, "code">,
        ): string | undefined;
        sanitize(this: void, code: string): string;
        unpackConfig(this: void, field: string | null | undefined): string[];
    } = ...

    Everything about flowR's playground that is not the page itself: what a link to it carries, and how one is written. The page reads back exactly what Playground.link writes.

    Type Declaration

    • BaseRef: string

      where the page these links point at is served from

    • Box: typeof PlaygroundBox

      the boxes of the page a mark can point at

    • hash: function
      • Everything a fragment does not carry as itself is escaped, so a configuration's brackets, braces and quotes travel as %5B, %7B and %22 rather than as characters a chat client, a markdown reader or a terminal cuts the address at. What is left is what FragmentSafe lists: a fragment is not a query, so ,, : and ; stand in it as they are and keep a link readable. & and + are escaped beyond that, the first because it separates the fields here and the second because a reader takes it for a space. A link is also made not to end on punctuation, because that is where a chat client stops reading it.

        Parameters

        • this: void
        • fields: readonly (readonly [string, string])[]

        Returns string

    • Mark: {
          compress(this: void, marks: readonly PlaygroundMark[]): PlaygroundMark[];
          expand(this: void, marks: readonly string[]): PlaygroundMark[];
          isValid(this: void, mark: unknown): mark is PlaygroundMark;
      }

      what a link can point at

    • name: string
    • nameIndexIn: function
      • where a name stands in a line, as a name rather than as a substring of a longer one

        Parameters

        • this: void
        • text: string
        • name: string

        Returns number | undefined

    • packConfig: function
      • The configuration keys as one field. A key is a.b.c=<json>, and the json is brackets, braces and quotes that a fragment does not carry, so it travels packed like the script rather than as a run of %5B.

        Parameters

        • this: void
        • config: readonly string[]

        Returns string

    • positionOf: function
      • Where a criterion points in the given code, as the <line>:<column> the page opens the cursor on. 12@sum is the name sum in line 12, 12:5 that column, 12 the first name on the line.

        Parameters

        • this: void
        • code: string
        • criterion: string

        Returns string | undefined

    • sanitize: function
      • The same script with what is nobody's business taken out: the directories a path names, addresses, and whatever a name like token or password was set to. This is what makes a script safe enough to travel in a bug report, and it is best-effort: it is not a guarantee that nothing private is left.

        Parameters

        • this: void
        • code: string

        Returns string

    • unpackConfig: function
      • The keys back out of that field, which older links wrote out plainly and which is read either way.

        Parameters

        • this: void
        • field: string | null | undefined

        Returns string[]

    Playground.link({ code: 'x <- 1\nprint(x)', at: '2@x', marks: ['2@x'] });