< Summary

Information
Class: Elsa.Expressions.JavaScript.TypeDefinitions.Abstractions.TypeDefinitionProvider
Assembly: Elsa.Expressions.JavaScript
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/TypeDefinitions/Abstractions/TypeDefinitionProvider.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 40
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/TypeDefinitions/Abstractions/TypeDefinitionProvider.cs

#LineLine coverage
 1using Elsa.Expressions.JavaScript.TypeDefinitions.Builders;
 2using Elsa.Expressions.JavaScript.TypeDefinitions.Contracts;
 3using Elsa.Expressions.JavaScript.TypeDefinitions.Models;
 4
 5namespace Elsa.Expressions.JavaScript.TypeDefinitions.Abstractions;
 6
 7/// <summary>
 8/// A base class for type definition providers.
 9/// </summary>
 10public abstract class TypeDefinitionProvider : ITypeDefinitionProvider
 11{
 12    /// <summary>
 13    /// Returns a list of type definitions to the system.
 14    /// </summary>
 15    protected virtual ValueTask<IEnumerable<TypeDefinition>> GetTypeDefinitionsAsync(TypeDefinitionContext context)
 16    {
 017        var functions = GetTypeDefinitions(context);
 018        return new(functions);
 19    }
 20
 21    /// <summary>
 22    /// Returns a list of type definitions to the system.
 23    /// </summary>
 24    protected virtual IEnumerable<TypeDefinition> GetTypeDefinitions(TypeDefinitionContext context)
 25    {
 026        yield break;
 27    }
 28
 029    async ValueTask<IEnumerable<TypeDefinition>> ITypeDefinitionProvider.GetTypeDefinitionsAsync(TypeDefinitionContext c
 30
 31    /// <summary>
 32    /// Provides a fluid API to build a type definition.
 33    /// </summary>
 34    protected TypeDefinition CreateTypeDefinition(Action<TypeDefinitionBuilder> setup)
 35    {
 036        var builder = new TypeDefinitionBuilder();
 037        setup(builder);
 038        return builder.BuildTypeDefinition();
 39    }
 40}