Skip to content

feat: support delegates#208

Merged
elringus merged 9 commits into
mainfrom
feat/delegates
May 23, 2026
Merged

feat: support delegates#208
elringus merged 9 commits into
mainfrom
feat/delegates

Conversation

@elringus
Copy link
Copy Markdown
Owner

@elringus elringus commented May 23, 2026

This adds support for delegates and resolves #183.

Any kind of delegate is supported: Action<>, Func<> or custom types created with the delegate keyword. Delegates are supported on all surface types (static, module and instanced) and members (method, property, event).

In JavaScript the delegates are materialized as plain callable functions, for example:

public class Class
{
    [Export] public static Action<string>? Logger { get; set; }
}

— produces following type declaration:

export namespace Class {
    export let logger: Action<string> | undefined;
}

— and can be used like this:

import { Class } from "bootsharp";

Class.logger = msg => console.log(msg);
Class.logger("hello");

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (170dc51) to head (f95c539).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #208   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           60        60           
  Lines         2771      2845   +74     
  Branches       465       479   +14     
=========================================
+ Hits          2771      2845   +74     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elringus elringus merged commit afc1fd6 into main May 23, 2026
8 checks passed
@elringus elringus deleted the feat/delegates branch May 23, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing JSON Converter Definition

1 participant