{"id":13629545,"url":"https://github.com/surgicalcoder/BlazorInteropGenerator","last_synced_at":"2025-04-17T09:34:35.227Z","repository":{"id":144112277,"uuid":"458497259","full_name":"surgicalcoder/BlazorInteropGenerator","owner":"surgicalcoder","description":"Generates Blazor -\u003e Javascript strongly typed interop methods.","archived":false,"fork":false,"pushed_at":"2024-11-20T16:38:50.000Z","size":42,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T01:46:38.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surgicalcoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-12T11:06:40.000Z","updated_at":"2025-03-16T05:41:18.000Z","dependencies_parsed_at":"2024-06-21T16:54:30.659Z","dependency_job_id":"b14a8e25-f3a3-42e0-b4aa-cf22d3bad206","html_url":"https://github.com/surgicalcoder/BlazorInteropGenerator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surgicalcoder%2FBlazorInteropGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surgicalcoder%2FBlazorInteropGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surgicalcoder%2FBlazorInteropGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surgicalcoder%2FBlazorInteropGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surgicalcoder","download_url":"https://codeload.github.com/surgicalcoder/BlazorInteropGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249331877,"owners_count":21252660,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:01:13.268Z","updated_at":"2025-04-17T09:34:35.218Z","avatar_url":"https://github.com/surgicalcoder.png","language":"C#","readme":"# BlazorInteropGenerator\nGenerates Blazor -\u003e Javascript strongly typed interop methods, by parsing the Javascript it self and generating extension methods for IJSRuntime.\n\n## Usage\n\nFirstly, add the project from Nuget - [GoLive.Generator.BlazorInterop](https://www.nuget.org/packages/GoLive.Generator.BlazorInterop/), then add an AdditionalFile in your .csproj named \"BlazorInterop.json\", like so:\n\n```\n\u003cItemGroup\u003e\n     \u003cAdditionalFiles Include=\"BlazorInterop.json\" /\u003e\n\u003c/ItemGroup\u003e\n```\n\nOnce that's done, add the settings file and change as required:\n\n\n```\n{\n  \"Files\": [\n    {\n      \"Output\": \"JSInterop.cs\",\n      \"Source\": \"wwwroot\\\\blazorinterop.js\",\n      \"Namespace\": \"GoLive.Generator.BlazorInterop.Playground.Client\",\n      \"ObjectToInterop\": \"window.blazorInterop\",\n      \"Init\": [\"window={}\"]\n    }\n  ],\n  \"InvokeVoidString\": \"await JSRuntime.InvokeVoidAsync(\\\"{0}\\\", {1});\",\n  \"InvokeString\": \"return await JSRuntime.InvokeAsync\u003cT\u003e(\\\"{0}\\\",{1});\"\n}\n\n```\n\n### Description of Each Option\n- Files: An array of file objects specifying details of the files involved in the interop process.\n  - Output: The name of the output C# file to be generated.\n  - Source: The path to the source JavaScript file used for the interop.\n  - Namespace: The namespace used in the generated C# file.\n  - ObjectToInterop: The JavaScript object used for the interop. \n  - Init: An array of initialization scripts executed before the interop. In this example above, we are interop'ing to window.blazorInterop, and window doesn't exist, so we have to create it.\n- InvokeVoidString: A template string for invoking a JavaScript function that does not return a value using JSRuntime.InvokeVoidAsync. Placeholders {0} and {1} are replaced with the function name and arguments, respectively.\n- InvokeString: A template string for invoking a JavaScript function that returns a value using JSRuntime.InvokeAsync\u003cT\u003e. Placeholders {0} and {1} are replaced with the function name and arguments, respectively.","funding_links":[],"categories":["Source Generators","Source generators","Content"],"sub_categories":["Webprogramming","Others","172. [GoLive.Generator.BlazorInterop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/GoLive.Generator.BlazorInterop) , in the [Blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) category"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurgicalcoder%2FBlazorInteropGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurgicalcoder%2FBlazorInteropGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurgicalcoder%2FBlazorInteropGenerator/lists"}