Selva Compute API Reference - v1.1.2
    Preparing search index...

    Function fetchParsedDefinitionIO

    • Fetches and processes input/output schemas from a Grasshopper definition. Returns strongly-typed, validated input parameters ready for use.

      This is the recommended way to fetch definition I/O schemas.

      Parameters

      • definition: string | Uint8Array<ArrayBufferLike>

        The Grasshopper definition (URL, base64 string, or Uint8Array)

      • config: ComputeConfig

        Compute configuration (server URL, API key, etc.)

      Returns Promise<GrasshopperParsedIO>

      Processed inputs with discriminated union types and outputs

      If fetch fails or response is invalid

      const { inputs, outputs } = await fetchParsedDefinitionIO(
      'https://example.com/definition.gh',
      { serverUrl: 'https://compute.rhino3d.com', apiKey: 'YOUR_KEY' }
      );

      // Inputs are now strongly typed
      inputs.forEach(input => {
      if (input.paramType === 'Number') {
      console.log(input.minimum, input.maximum); // TypeScript knows these exist
      }
      });