Skip to content

Commit

Permalink
Splitting GraphRunner into public API declared interfaces and private…
Browse files Browse the repository at this point in the history
… TS impls

PiperOrigin-RevId: 564551973
  • Loading branch information
MediaPipe Team authored and copybara-github committed Sep 12, 2023
1 parent 0fec532 commit 02bd0d9
Show file tree
Hide file tree
Showing 6 changed files with 929 additions and 596 deletions.
52 changes: 50 additions & 2 deletions mediapipe/web/graph_runner/BUILD
Original file line number Diff line number Diff line change
@@ -1,19 +1,67 @@
# The TypeScript graph runner used by all MediaPipe Web tasks.

load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_library")
load("//mediapipe/framework/port:build_config.bzl", "mediapipe_ts_declaration", "mediapipe_ts_library")
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")

package(default_visibility = [
"//mediapipe/tasks:internal",
])

# Public types for GraphRunner listeners
mediapipe_ts_declaration(
name = "listener_types",
srcs = [
"listener_types.d.ts",
],
visibility = ["//visibility:private"],
)

# Public API for GraphRunner
mediapipe_ts_declaration(
name = "graph_runner_api",
srcs = [
"graph_runner_api.d.ts",
],
deps = [
":listener_types",
":wasm_module_private",
],
)

# Public API for GraphRunner creation factory functions
mediapipe_ts_library(
name = "graph_runner_factory_api",
srcs = [
"graph_runner_factory_api.d.ts",
],
deps = [
":graph_runner_api",
":wasm_module_private",
],
)

# Private declarations for the Wasm module
mediapipe_ts_declaration(
name = "wasm_module_private",
srcs = ["wasm_module.d.ts"],
visibility = ["//visibility:private"],
deps = [":listener_types"],
)

# Internal GraphRunner implementation
mediapipe_ts_library(
name = "graph_runner_ts",
srcs = [
":graph_runner.ts",
],
allow_unoptimized_namespaces = True,
deps = [":platform_utils"],
deps = [
":graph_runner_api",
":graph_runner_factory_api",
":listener_types",
":platform_utils",
":wasm_module_private",
],
)

mediapipe_ts_library(
Expand Down
Loading

0 comments on commit 02bd0d9

Please sign in to comment.