From a3d9c9fff2bddc9a4ec0ac7f2c8985e0ae23f2df Mon Sep 17 00:00:00 2001 From: facebook-github-bot Date: Fri, 8 Nov 2024 19:58:00 +0000 Subject: [PATCH] deploy: 37bef9240beb705cfeeb5065a68419ef50121d16 --- 404.html | 10 +-- ...tyles.2a1011f0.css => styles.5914de60.css} | 2 +- ...e0bf7.778c7c1e.js => 015e0bf7.5d199488.js} | 2 +- ...eefc4.8a0b715b.js => 086eefc4.03e603d2.js} | 2 +- ...3082f.1f211aa5.js => 0d63082f.d417ec8e.js} | 2 +- ...6ea57.a75b63cc.js => 0ee6ea57.47f61e7a.js} | 2 +- ...76b7a.56f5a672.js => 1bb76b7a.1a3042ad.js} | 2 +- ...78505.c37e911a.js => 1be78505.70c35879.js} | 2 +- ...ba521.2269d03f.js => 26eba521.43522dbc.js} | 2 +- ...52c34.f127ad7f.js => 27652c34.748f0e3d.js} | 2 +- ...affd8.7eefb6b1.js => 2d8affd8.3a293416.js} | 2 +- ...ac66d.8977e88d.js => 2ecac66d.ca2bfef5.js} | 2 +- ...1de3b.cc1adde6.js => 3531de3b.2f99d91d.js} | 2 +- ...7bbe9.dff82b54.js => 4527bbe9.77342189.js} | 2 +- ...7db6f.0d7c34cf.js => 5a17db6f.80b42791.js} | 2 +- ...d4bc5.ef44b4eb.js => 5b1d4bc5.d45742d0.js} | 2 +- ...78946.13193e11.js => 5be78946.43c9e803.js} | 2 +- ...d7254.5ae8e530.js => 6b5d7254.64aef8a7.js} | 2 +- ...ddb53.31eb1560.js => 72eddb53.a0bea85c.js} | 2 +- ...1a35a.e54ac600.js => 8b21a35a.cae5f0be.js} | 2 +- ...06942.b30f45e9.js => 95206942.4a54f404.js} | 2 +- ...47cf5.bcbcdcb1.js => 95f47cf5.60e1b663.js} | 2 +- ...9c166.edf58baf.js => 98c9c166.af6a7b11.js} | 2 +- ...f1d78.b6db68f3.js => b53f1d78.67102bec.js} | 2 +- ...dd339.1b56382d.js => c90dd339.08246fda.js} | 2 +- ...2388a.04a3ce53.js => e012388a.ebe92a19.js} | 2 +- ...6f3cc.4faa71dc.js => e4c6f3cc.6d8da579.js} | 2 +- ...f92ec.84c854af.js => f40f92ec.10161c85.js} | 2 +- ...99c11.f4fd2a5c.js => f8599c11.a86b69ff.js} | 2 +- ...c0a35.76020411.js => fc5c0a35.9385b9e4.js} | 2 +- assets/js/main.0664c0d2.js | 2 + ...CENSE.txt => main.0664c0d2.js.LICENSE.txt} | 0 assets/js/main.3fb7c0f0.js | 2 - assets/js/runtime~main.ab4e3681.js | 1 + assets/js/runtime~main.ddc8ba6d.js | 1 - .../index.html | 18 ++--- .../api_src.SnapshotResultReader/index.html | 16 ++--- .../heap_analysis_src.BaseAnalysis/index.html | 20 +++--- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- .../index.html | 14 ++-- docs/api/enums/api_src.ConsoleMode/index.html | 12 ++-- docs/api/index.html | 10 +-- .../core_src.IBrowserInfo/index.html | 12 ++-- .../interfaces/core_src.IHeapEdge/index.html | 26 +++---- .../interfaces/core_src.IHeapEdges/index.html | 16 ++--- .../core_src.IHeapLocation/index.html | 16 ++--- .../interfaces/core_src.IHeapNode/index.html | 70 +++++++++--------- .../interfaces/core_src.IHeapNodes/index.html | 16 ++--- .../core_src.IHeapSnapshot/index.html | 28 ++++---- .../core_src.IHeapStringNode/index.html | 72 +++++++++---------- .../core_src.ILeakFilter/index.html | 16 ++--- .../interfaces/core_src.IScenario/index.html | 32 ++++----- docs/api/modules/api_src/index.html | 24 +++---- docs/api/modules/core_src/index.html | 38 +++++----- docs/api/modules/heap_analysis_src/index.html | 30 ++++---- docs/cli/CLI-commands/index.html | 10 +-- docs/getting-started/index.html | 10 +-- docs/guides/guides-detached-dom/index.html | 10 +-- .../guides-detect-oversized-object/index.html | 10 +-- docs/guides/guides-find-leaks/index.html | 10 +-- .../integrate-with-e2e-frameworks/index.html | 10 +-- .../integration-and-file-structure/index.html | 10 +-- docs/how-memlab-works/index.html | 10 +-- docs/installation/index.html | 10 +-- docs/intro/index.html | 10 +-- index.html | 10 +-- search/index.html | 10 +-- under-construction/index.html | 10 +-- 76 files changed, 408 insertions(+), 408 deletions(-) rename assets/css/{styles.2a1011f0.css => styles.5914de60.css} (64%) rename assets/js/{015e0bf7.778c7c1e.js => 015e0bf7.5d199488.js} (98%) rename assets/js/{086eefc4.8a0b715b.js => 086eefc4.03e603d2.js} (97%) rename assets/js/{0d63082f.1f211aa5.js => 0d63082f.d417ec8e.js} (97%) rename assets/js/{0ee6ea57.a75b63cc.js => 0ee6ea57.47f61e7a.js} (95%) rename assets/js/{1bb76b7a.56f5a672.js => 1bb76b7a.1a3042ad.js} (91%) rename assets/js/{1be78505.c37e911a.js => 1be78505.70c35879.js} (99%) rename assets/js/{26eba521.2269d03f.js => 26eba521.43522dbc.js} (97%) rename assets/js/{27652c34.f127ad7f.js => 27652c34.748f0e3d.js} (94%) rename assets/js/{2d8affd8.7eefb6b1.js => 2d8affd8.3a293416.js} (82%) rename assets/js/{2ecac66d.8977e88d.js => 2ecac66d.ca2bfef5.js} (97%) rename assets/js/{3531de3b.cc1adde6.js => 3531de3b.2f99d91d.js} (88%) rename assets/js/{4527bbe9.dff82b54.js => 4527bbe9.77342189.js} (98%) rename assets/js/{5a17db6f.0d7c34cf.js => 5a17db6f.80b42791.js} (98%) rename assets/js/{5b1d4bc5.ef44b4eb.js => 5b1d4bc5.d45742d0.js} (97%) rename assets/js/{5be78946.13193e11.js => 5be78946.43c9e803.js} (98%) rename assets/js/{6b5d7254.5ae8e530.js => 6b5d7254.64aef8a7.js} (97%) rename assets/js/{72eddb53.31eb1560.js => 72eddb53.a0bea85c.js} (98%) rename assets/js/{8b21a35a.e54ac600.js => 8b21a35a.cae5f0be.js} (95%) rename assets/js/{95206942.b30f45e9.js => 95206942.4a54f404.js} (98%) rename assets/js/{95f47cf5.bcbcdcb1.js => 95f47cf5.60e1b663.js} (98%) rename assets/js/{98c9c166.edf58baf.js => 98c9c166.af6a7b11.js} (92%) rename assets/js/{b53f1d78.b6db68f3.js => b53f1d78.67102bec.js} (95%) rename assets/js/{c90dd339.1b56382d.js => c90dd339.08246fda.js} (95%) rename assets/js/{e012388a.04a3ce53.js => e012388a.ebe92a19.js} (97%) rename assets/js/{e4c6f3cc.4faa71dc.js => e4c6f3cc.6d8da579.js} (97%) rename assets/js/{f40f92ec.84c854af.js => f40f92ec.10161c85.js} (93%) rename assets/js/{f8599c11.f4fd2a5c.js => f8599c11.a86b69ff.js} (97%) rename assets/js/{fc5c0a35.76020411.js => fc5c0a35.9385b9e4.js} (97%) create mode 100644 assets/js/main.0664c0d2.js rename assets/js/{main.3fb7c0f0.js.LICENSE.txt => main.0664c0d2.js.LICENSE.txt} (100%) delete mode 100644 assets/js/main.3fb7c0f0.js create mode 100644 assets/js/runtime~main.ab4e3681.js delete mode 100644 assets/js/runtime~main.ddc8ba6d.js diff --git a/404.html b/404.html index a7d9961f8..59be93511 100644 --- a/404.html +++ b/404.html @@ -9,15 +9,15 @@ -Page Not Found | memlab - - +Page Not Found | memlab + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/assets/css/styles.2a1011f0.css b/assets/css/styles.5914de60.css similarity index 64% rename from assets/css/styles.2a1011f0.css rename to assets/css/styles.5914de60.css index 32a5b89e1..a1d5876ce 100644 --- a/assets/css/styles.2a1011f0.css +++ b/assets/css/styles.5914de60.css @@ -1 +1 @@ -.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown li,body{word-wrap:break-word}body,ol ol,ol ul,ul ol,ul ul{margin:0}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.admonition-icon svg,.alert__icon svg{fill:var(--ifm-alert-foreground-color)}#left-header-section,article{margin-right:auto;margin-left:auto}*,.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:#0000;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:#0000000d;--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 #0000001a;--ifm-global-shadow-md:0 5px 40px #0003;--ifm-global-shadow-tl:0 12px 28px 0 #0003,0 2px 4px 0 #0000001a;--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:#0000;--ifm-table-stripe-background:#00000008;--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem;--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-code-font-size:95%;--doc-sidebar-width:330px!important;--ifm-color-content:#172531;--ifm-color-primary:#32accd;--ifm-color-primary-dark:#2d9bb9;--ifm-color-primary-darker:#2a92ae;--ifm-color-primary-darkest:#237890;--ifm-color-primary-light:#47b4d2;--ifm-color-primary-lighter:#51b8d4;--ifm-color-primary-lightest:#70c5dc;--ifm-container-width:1140px;--ifm-table-cell-padding:0.35rem;--ifm-paragraph-margin:0rem;--ifm-font-family-base:-apple-system,BlinkMacSystemFont,"Segoe UI",Oxygen,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:#656c85cc;--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 #ffffff80,0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px #1e235a66;--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 #1e235a66;--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 #45629b1f;--docsearch-primary-color:var(--ifm-color-primary);--docsearch-text-color:var(--ifm-font-color-base);--docusaurus-announcement-bar-height:auto;--docusaurus-collapse-button-bg:#0000;--docusaurus-collapse-button-bg-hover:#0000001a;--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:#0000}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.row--align-top{align-items:flex-start}.row--align-bottom{align-items:flex-end}.menuExternalLink_NmtK,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-vert--md{padding-top:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid #0000001a;border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}a code{color:inherit;color:var(--ifm-link-color)}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}pre code{background-color:initial;border:none;font-size:100%;line-height:inherit;padding:0}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);border-radius:.2rem;box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace);padding:.15rem .3rem}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}.features_keug h3,article h1,article h2,article h3,article strong,code{font-weight:600}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0;background-color:#3c3c3c1f}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_EoeP .wordWrapButtonIcon_Bwma{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.text--left{text-align:left}.text--justify{text-align:justify}.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.admonition h5,.alert__heading,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;padding:0}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:#3578e526;--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:#ebedf026;--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:#00a40026;--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:#54c7ec26;--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:#ffba0026;--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:#fa383e26;--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover){color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;-webkit-user-select:none;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:#0000;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;opacity:.5;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover{opacity:.7}.close:focus,.theme-code-block-highlighted-line .codeLineNumber_Tfdd:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(0);visibility:visible}#nprogress,.dropdown__menu,.navbar__item.dropdown .navbar__link:not([href]){pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor #0000;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:10rem}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.docItemContainer_Adtb article>:first-child,.docItemContainer_Adtb header+*,.footer__item{margin-top:0}.admonition-content>:last-child,.collapsibleContent_i85q>:last-child,.footer__items{margin-bottom:0}.codeBlockStandalone_MEMb,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex;padding:4rem 2rem}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title{font-size:3rem}.hero__subtitle{font-size:1.5rem}.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.details_lb9f[data-collapsed=false].isBrowser_bmU9>summary:before,.details_lb9f[open]:not(.isBrowser_bmU9)>summary:before,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{bottom:0;opacity:0;transition-timing-function:ease-in-out;top:0;left:0;visibility:hidden}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem;content:"";filter:var(--ifm-menu-link-sublist-icon-filter)}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand{margin:0}.navbar__items--center+.navbar__items--right{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:#ffffff1a;--ifm-navbar-search-input-placeholder-color:#ffffff80;color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:#ffffff0d;--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-duration:.25s;transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:#0009;position:fixed;right:0;transition-duration:.1s;transition-property:opacity,visibility}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.pagination__item{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination__link:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item{border-radius:.5rem;cursor:pointer;display:inline-block;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs,:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto}.tabs__item{border-bottom:3px solid #0000;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:#ffffff0d;--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:#ffffff1a;--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:#ffffff12;--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec;--docsearch-text-color:#f5f6f7;--docsearch-container-background:#090a11cc;--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 #0304094d;--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 rgba(3,4,9,.302);--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 #494c6a80,0 -4px 8px 0 #0003;--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.admonition h5{margin-bottom:8px;margin-top:0}.admonition h5 code{text-transform:none}.admonition-icon{display:inline-block;margin-right:.4em;vertical-align:middle}.admonition-icon svg{stroke-width:0;stroke:var(--ifm-alert-foreground-color);display:inline-block;height:22px;width:22px}.admonition{margin-bottom:1em}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}:root .prism-code{--ifm-code-font-size:85%}[data-theme=dark]{--ifm-color-primary:#32accd;--ifm-color-primary-dark:#2d9bb9;--ifm-color-primary-darker:#2a92ae;--ifm-color-primary-darkest:#237890;--ifm-color-primary-light:#47b4d2;--ifm-color-primary-lighter:#51b8d4;--ifm-color-primary-lightest:#70c5dc}.padding-top--md{padding-top:32px!important}article{max-width:730px}article h1{font-size:32px!important}article h1 code{font-size:30px!important}article h2{border-top:1px solid #3c3c3c1f;font-size:24px!important;letter-spacing:-.02em;margin:48px 0 16px;padding-top:24px}[data-theme=dark] article h2{border-top:1px solid #5454547a}article h2 code{font-size:22px!important}article h3{font-size:20px!important}article h3 code{font-size:18px!important}.navbar .navbar__items{flex:auto}[data-theme=dark] hr{background-color:#5454547a}code{border:none;border-radius:4px;color:var(--ifm-color-gray-800);font-family:monospace,Courier New,Courier;padding:3px 6px}[data-theme=dark] code{color:var(--ifm-color-gray-200)}#header-animation-canvas{height:100%;position:absolute;top:0;width:100%;z-index:-1}#sub-title,#title{color:#323330;font-family:circular,Segoe UI,sans-serif,Tahoma,Geneva,Verdana;text-shadow:1px 1px 1px #d1b73d}#learn-more{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);color:#323330}#header-container{word-wrap:normal;display:flex}#left-header-section{flex:2;margin-top:8%}#css-animated-bg-container{background:linear-gradient(#ffe53b,#dac540);border-bottom:1px solid #000;padding-bottom:0;padding-top:16px}.iconEdit_eYIM{margin-right:.3em;vertical-align:sub}.tag_zVej{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_zVej:hover{--docusaurus-tag-list-border:var(--ifm-link-color);text-decoration:none}.tagRegular_sFm0{border-radius:.5rem;font-size:90%;padding:.3rem .5rem}.tagWithCount_h2kH{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tagWithCount_h2kH:after,.tagWithCount_h2kH:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_h2kH:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_h2kH:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_h2kH span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tags_jXut{display:inline}.tag_QGVx{display:inline-block;margin:0 .4rem .5rem 0}.lastUpdated_vbeJ{font-size:smaller;font-style:italic;margin-top:.2rem}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:0}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Hit-Tree,.DocSearch-Hit-action,.DocSearch-Hit-icon,.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;width:20px}.DocSearch-Button-Key--pressed{box-shadow:var(--docsearch-key-pressed-shadow);transform:translate3d(0,1px,0)}.DocSearch--active{overflow:hidden!important}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:#0000;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:0;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Cancel,.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator,.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset{animation:.1s ease-in forwards a;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0}.DocSearch-Help,.DocSearch-HitsFooter,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:#0000}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a,.docsWrapper_BCFX{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}.DocSearch-Hit--deleting{opacity:0;transition:.25s linear}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:.25s linear .25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}#docusaurus-base-url-issue-banner-container,.collapseSidebarButton_PEFL,.docSidebarContainer_b6E3,.sidebarLogo_isFc,.themedImage_ToTc,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j,svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon,.tocCollapsibleContent_vkbj a{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:0;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands li,.DocSearch-Commands-Key,.buttons_pzbO,.features_keug{align-items:center;display:flex}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@keyframes a{0%{opacity:0}to{opacity:1}}.DocSearch-Button{margin:0;transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.DocSearch-Container,.skipToContent_fXgn{z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_fXgn{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem}.skipToContent_fXgn:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.announcementBar_mb4j{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_vyr4{flex:0 0 10px}.announcementBarClose_gvF7{align-self:stretch;flex:0 0 30px;line-height:0;padding:0}.announcementBarContent_xLdY{flex:1 1 auto;font-size:85%;padding:5px 0;text-align:center}.announcementBarContent_xLdY a{color:inherit;text-decoration:underline}.toggle_vylO{height:2rem;width:2rem}.toggleButton_gllP{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton_gllP:hover{background:var(--ifm-color-emphasis-200)}.toggleButtonDisabled_aARS{cursor:not-allowed}[data-theme=dark] .themedImage--dark_i4oU,[data-theme=light] .themedImage--light_HNdA{display:initial}.iconExternalLink_lCJq{margin-left:.3rem}.iconLanguage_nlXk{margin-right:5px;vertical-align:text-bottom}.navbarHideable_m1mJ{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_jGov{transform:translate3d(0,calc(-100% - 2px),0)}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}.footerLogoLink_BH7S{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.footerLogoLink_BH7S:hover,.hash-link:focus,:hover>.hash-link{opacity:1}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.main-wrapper{flex:1 0 auto}.docusaurus-mt-lg{margin-top:3rem}.searchQueryInput_fOvw,.searchVersionInput_uwCD{background:var(--docsearch-searchbox-focus-background);border:2px solid var(--ifm-toc-border-color);border-radius:var(--ifm-global-radius);color:var(--docsearch-text-color);font:var(--ifm-font-size-base) var(--ifm-font-family-base);margin-bottom:.5rem;padding:.8rem;transition:border var(--ifm-transition-fast) ease;width:100%}.searchQueryInput_fOvw:focus,.searchVersionInput_uwCD:focus{border-color:var(--docsearch-primary-color);outline:0}.searchQueryInput_fOvw::placeholder{color:var(--docsearch-muted-color)}.searchResultsColumn_XAOM{font-size:.9rem;font-weight:700}.algoliaLogo_lMQB{max-width:150px}.algoliaLogoPathFill_UGFK{fill:var(--ifm-font-color-base)}.searchResultItem_RfWM{border-bottom:1px solid var(--ifm-toc-border-color);padding:1rem 0}.searchResultItemHeading_cu9x{font-weight:400;margin-bottom:0}.searchResultItemPath_bRHw{--ifm-breadcrumb-separator-size-multiplier:1;color:var(--ifm-color-content-secondary);font-size:.8rem}.searchResultItemSummary_gq1k{font-style:italic;margin:.5rem 0 0}.loadingSpinner_bRrL{animation:1s linear infinite b;border:.4em solid #eee;border-radius:50%;border-top:.4em solid var(--ifm-color-primary);height:3rem;margin:0 auto;width:3rem}@keyframes b{to{transform:rotate(1turn)}}.loader_Ubv2{margin-top:2rem}.search-result-match{background:#ffd78e40;color:var(--docsearch-hit-color);padding:.09em 0}.showcaseHeadingColored_wr9e,.titleLink_sVF8{color:var(--ifm-color-content)}.backToTopButton_sjWU{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_sjWU:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_xfvO{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:#ffffff0d;--docusaurus-collapse-button-bg-hover:#ffffff1a}.docMainContainer_gTbr,.docPage__5DB{display:flex;width:100%}.heroBanner_UJJx{overflow:hidden;padding:4rem 0;position:relative;text-align:center}.buttons_pzbO,.mdxPageWrapper_j9I6{justify-content:center}.features_keug{padding:2rem 0;width:100%}.featureImage_yA8i{height:200px;width:200px}.showcase_SATw{padding:0 20px 80px}.showcaseHeading_iAvm{font-size:30px;line-height:1em;margin-top:20px;padding:10px 0}.showcaseHeadingColored_wr9e{font-weight:600}.showcaseLogos_MhuO{flex-flow:row wrap;padding:20px}.showcaseLogo_uMXs,.showcaseLogos_MhuO{align-items:center;display:flex;justify-content:center}.showcaseLogo_uMXs{background:#0000;border-radius:8px;height:100px;margin:15px;padding:5px;width:100px}[data-theme=dark] .titleLink_sVF8{color:var(--ifm-link-color)}.terminal{-webkit-font-smoothing:auto;word-wrap:normal;background:#0000;background-color:initial!important;border:0;color:#f0f0f0;display:inline-block;font-family:DejaVu Sans Mono,Liberation Mono,monospace,Monaco;font-size:13px;text-align:left;width:100%}span.terminal-cursor{background-color:#f0f0f0;width:10px}.terminal-inner{background:#171923;border-radius:6px;min-height:400px;padding:10px 10px 6px;width:780px}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.terminal-content{line-height:16px;margin:20px auto;width:780px}.codeBlockContainer_Ckt0{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_biex{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_Ktv7{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_bY9V{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_Ktv7+.codeBlockContent_biex .codeBlock_bY9V{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_e6Vv{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_o6Pm{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup__atx{column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup__atx button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity .2s ease-in-out}.buttonGroup__atx button:focus-visible,.buttonGroup__atx button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup__atx button{opacity:.4}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.codeLine_lJS_{counter-increment:a;display:table-row}.codeLineNumber_Tfdd{background:var(--ifm-pre-background);display:table-cell;left:0;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_Tfdd:before{content:counter(a);opacity:.4}.codeLineContent_feaV{padding-right:var(--ifm-pre-padding)}.theme-code-block:hover .copyButtonCopied_obH4{opacity:1!important}.copyButtonIcons_eSgA{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_y97N,.copyButtonSuccessIcon_LjdS{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:.15s;width:inherit}.copyButtonSuccessIcon_LjdS{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_obH4 .copyButtonIcon_y97N{opacity:0;transform:scale(.33)}.copyButtonCopied_obH4 .copyButtonSuccessIcon_LjdS{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.wordWrapButtonIcon_Bwma{height:1.2rem;width:1.2rem}.tableOfContents_bqdL{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.tocCollapsibleButton_TO0P{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_TO0P:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_MG3E:after,.tocCollapsibleExpanded_sAul{transform:none}.tocCollapsible_ETCw{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.tocCollapsibleContent_vkbj>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_vkbj ul li{margin:.4rem .8rem}.anchorWithStickyNavbar_LWe7{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_WYt5{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);-webkit-user-select:none;user-select:none}.hash-link:before{content:"#"}.breadcrumbsContainer_Z_bl{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.breadcrumbHomeIcon_OVgt{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.details_lb9f{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_lb9f>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_lb9f>summary::-webkit-details-marker{display:none}.details_lb9f>summary:before{border-color:#0000 #0000 #0000 var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_i85q{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_b_Ee{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.containsTaskList_mC6p{list-style:none}.img_ev3q{height:auto}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_m80_{background-color:var(--docusaurus-collapse-button-bg);position:sticky}.lastUpdated_vbeJ{text-align:right}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.searchBox_ZlJk{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.collapseSidebarButton_PEFL{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px}.collapseSidebarButtonIcon_kv0_{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_BlDH,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_m80_:focus,.expandButton_m80_:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_M9Kj{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_SIkG{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_SIkG{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_GW3s{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_njMd{display:flex;flex-direction:column;height:100%;max-height:100vh;padding-top:var(--ifm-navbar-height);position:sticky;top:0;transition:opacity 50ms;width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_wUlq{padding-top:0}.sidebarHidden_VK0M{height:0;opacity:0;overflow:hidden;visibility:hidden}.sidebarLogo_isFc{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_isFc img{height:2rem;margin-right:.5rem}.expandButton_m80_{align-items:center;display:flex;height:100%;justify-content:center;max-height:100vh;top:0;transition:background-color var(--ifm-transition-fast) ease}[dir=rtl] .expandButtonIcon_BlDH{transform:rotate(180deg)}.docSidebarContainer_b6E3{border-right:1px solid var(--ifm-toc-border-color);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_b3ry{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.docMainContainer_gTbr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_Uz_u{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_czyv{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}.docItemCol_GujU{max-width:75%!important}.tocMobile_aoJ5{display:none}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_DEke,.footer__link-separator,.navbar__item,.tableOfContents_bqdL{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_ZlJk{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_F8PC{padding:0 .3rem}}@media only screen and (max-width:996px){.searchQueryColumn_vJqv,.searchResultsColumn_XAOM{max-width:60%!important}.searchLogoColumn_D3Uo,.searchVersionColumn_Afdn{max-width:40%!important}.searchLogoColumn_D3Uo{padding-left:0!important}}@media screen and (max-width:996px){#css-animated-bg-container{background:linear-gradient(#ffe53b,#dac540);padding:1rem 0 60px}.heroBanner_UJJx{padding:2rem}}@media only screen and (max-width:780px){.terminal-content{display:none}}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder,.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%;max-height:calc(var(--docsearch-vh,1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Cancel{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:0;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}}@media screen and (max-width:576px){.searchQueryColumn_vJqv{max-width:100%!important}.searchVersionColumn_Afdn{max-width:100%!important;padding-left:var(--ifm-spacing-horizontal)!important}}@media (hover:hover){.backToTopButton_sjWU:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width);animation:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0}.DocSearch-Hit--deleting,.DocSearch-Hit--favoriting{transition:none}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}@media print{.announcementBar_mb4j,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_aoJ5{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_e6Vv{white-space:pre-wrap}} \ No newline at end of file +.col,.container{padding:0 var(--ifm-spacing-horizontal);width:100%}.markdown>h2,.markdown>h3,.markdown>h4,.markdown>h5,.markdown>h6{margin-bottom:calc(var(--ifm-heading-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown li,body{word-wrap:break-word}body,ol ol,ol ul,ul ol,ul ul{margin:0}pre,table{overflow:auto}blockquote,pre{margin:0 0 var(--ifm-spacing-vertical)}.breadcrumbs__link,.button{transition-timing-function:var(--ifm-transition-timing-default)}.button,code{vertical-align:middle}.button--outline.button--active,.button--outline:active,.button--outline:hover,:root{--ifm-button-color:var(--ifm-font-color-base-inverse)}.menu__link:hover,a{transition:color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.navbar--dark,:root{--ifm-navbar-link-hover-color:var(--ifm-color-primary)}.menu,.navbar-sidebar{overflow-x:hidden}:root,html[data-theme=dark]{--ifm-color-emphasis-500:var(--ifm-color-gray-500)}.admonition-icon svg,.alert__icon svg{fill:var(--ifm-alert-foreground-color)}#left-header-section,article{margin-right:auto;margin-left:auto}*,.DocSearch-Container,.DocSearch-Container *{box-sizing:border-box}.toggleButton_gllP,html{-webkit-tap-highlight-color:transparent}:root{--ifm-color-scheme:light;--ifm-dark-value:10%;--ifm-darker-value:15%;--ifm-darkest-value:30%;--ifm-light-value:15%;--ifm-lighter-value:30%;--ifm-lightest-value:50%;--ifm-contrast-background-value:90%;--ifm-contrast-foreground-value:70%;--ifm-contrast-background-dark-value:70%;--ifm-contrast-foreground-dark-value:90%;--ifm-color-primary:#3578e5;--ifm-color-secondary:#ebedf0;--ifm-color-success:#00a400;--ifm-color-info:#54c7ec;--ifm-color-warning:#ffba00;--ifm-color-danger:#fa383e;--ifm-color-primary-dark:#306cce;--ifm-color-primary-darker:#2d66c3;--ifm-color-primary-darkest:#2554a0;--ifm-color-primary-light:#538ce9;--ifm-color-primary-lighter:#72a1ed;--ifm-color-primary-lightest:#9abcf2;--ifm-color-primary-contrast-background:#ebf2fc;--ifm-color-primary-contrast-foreground:#102445;--ifm-color-secondary-dark:#d4d5d8;--ifm-color-secondary-darker:#c8c9cc;--ifm-color-secondary-darkest:#a4a6a8;--ifm-color-secondary-light:#eef0f2;--ifm-color-secondary-lighter:#f1f2f5;--ifm-color-secondary-lightest:#f5f6f8;--ifm-color-secondary-contrast-background:#fdfdfe;--ifm-color-secondary-contrast-foreground:#474748;--ifm-color-success-dark:#009400;--ifm-color-success-darker:#008b00;--ifm-color-success-darkest:#007300;--ifm-color-success-light:#26b226;--ifm-color-success-lighter:#4dbf4d;--ifm-color-success-lightest:#80d280;--ifm-color-success-contrast-background:#e6f6e6;--ifm-color-success-contrast-foreground:#003100;--ifm-color-info-dark:#4cb3d4;--ifm-color-info-darker:#47a9c9;--ifm-color-info-darkest:#3b8ba5;--ifm-color-info-light:#6ecfef;--ifm-color-info-lighter:#87d8f2;--ifm-color-info-lightest:#aae3f6;--ifm-color-info-contrast-background:#eef9fd;--ifm-color-info-contrast-foreground:#193c47;--ifm-color-warning-dark:#e6a700;--ifm-color-warning-darker:#d99e00;--ifm-color-warning-darkest:#b38200;--ifm-color-warning-light:#ffc426;--ifm-color-warning-lighter:#ffcf4d;--ifm-color-warning-lightest:#ffdd80;--ifm-color-warning-contrast-background:#fff8e6;--ifm-color-warning-contrast-foreground:#4d3800;--ifm-color-danger-dark:#e13238;--ifm-color-danger-darker:#d53035;--ifm-color-danger-darkest:#af272b;--ifm-color-danger-light:#fb565b;--ifm-color-danger-lighter:#fb7478;--ifm-color-danger-lightest:#fd9c9f;--ifm-color-danger-contrast-background:#ffebec;--ifm-color-danger-contrast-foreground:#4b1113;--ifm-color-white:#fff;--ifm-color-black:#000;--ifm-color-gray-0:var(--ifm-color-white);--ifm-color-gray-100:#f5f6f7;--ifm-color-gray-200:#ebedf0;--ifm-color-gray-300:#dadde1;--ifm-color-gray-400:#ccd0d5;--ifm-color-gray-500:#bec3c9;--ifm-color-gray-600:#8d949e;--ifm-color-gray-700:#606770;--ifm-color-gray-800:#444950;--ifm-color-gray-900:#1c1e21;--ifm-color-gray-1000:var(--ifm-color-black);--ifm-color-emphasis-0:var(--ifm-color-gray-0);--ifm-color-emphasis-100:var(--ifm-color-gray-100);--ifm-color-emphasis-200:var(--ifm-color-gray-200);--ifm-color-emphasis-300:var(--ifm-color-gray-300);--ifm-color-emphasis-400:var(--ifm-color-gray-400);--ifm-color-emphasis-600:var(--ifm-color-gray-600);--ifm-color-emphasis-700:var(--ifm-color-gray-700);--ifm-color-emphasis-800:var(--ifm-color-gray-800);--ifm-color-emphasis-900:var(--ifm-color-gray-900);--ifm-color-emphasis-1000:var(--ifm-color-gray-1000);--ifm-color-content:var(--ifm-color-emphasis-900);--ifm-color-content-inverse:var(--ifm-color-emphasis-0);--ifm-color-content-secondary:#525860;--ifm-background-color:#0000;--ifm-background-surface-color:var(--ifm-color-content-inverse);--ifm-global-border-width:1px;--ifm-global-radius:0.4rem;--ifm-hover-overlay:#0000000d;--ifm-font-color-base:var(--ifm-color-content);--ifm-font-color-base-inverse:var(--ifm-color-content-inverse);--ifm-font-color-secondary:var(--ifm-color-content-secondary);--ifm-font-family-base:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--ifm-font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--ifm-font-size-base:100%;--ifm-font-weight-light:300;--ifm-font-weight-normal:400;--ifm-font-weight-semibold:500;--ifm-font-weight-bold:700;--ifm-font-weight-base:var(--ifm-font-weight-normal);--ifm-line-height-base:1.65;--ifm-global-spacing:1rem;--ifm-spacing-vertical:var(--ifm-global-spacing);--ifm-spacing-horizontal:var(--ifm-global-spacing);--ifm-transition-fast:200ms;--ifm-transition-slow:400ms;--ifm-transition-timing-default:cubic-bezier(0.08,0.52,0.52,1);--ifm-global-shadow-lw:0 1px 2px 0 #0000001a;--ifm-global-shadow-md:0 5px 40px #0003;--ifm-global-shadow-tl:0 12px 28px 0 #0003,0 2px 4px 0 #0000001a;--ifm-z-index-dropdown:100;--ifm-z-index-fixed:200;--ifm-z-index-overlay:400;--ifm-container-width-xl:1320px;--ifm-code-background:#f6f7f8;--ifm-code-border-radius:var(--ifm-global-radius);--ifm-code-font-size:90%;--ifm-code-padding-horizontal:0.1rem;--ifm-code-padding-vertical:0.1rem;--ifm-pre-background:var(--ifm-code-background);--ifm-pre-border-radius:var(--ifm-code-border-radius);--ifm-pre-color:inherit;--ifm-pre-line-height:1.45;--ifm-pre-padding:1rem;--ifm-heading-color:inherit;--ifm-heading-margin-top:0;--ifm-heading-margin-bottom:var(--ifm-spacing-vertical);--ifm-heading-font-family:var(--ifm-font-family-base);--ifm-heading-font-weight:var(--ifm-font-weight-bold);--ifm-heading-line-height:1.25;--ifm-h1-font-size:2rem;--ifm-h2-font-size:1.5rem;--ifm-h3-font-size:1.25rem;--ifm-h4-font-size:1rem;--ifm-h5-font-size:0.875rem;--ifm-h6-font-size:0.85rem;--ifm-image-alignment-padding:1.25rem;--ifm-leading-desktop:1.25;--ifm-leading:calc(var(--ifm-leading-desktop)*1rem);--ifm-list-left-padding:2rem;--ifm-list-margin:1rem;--ifm-list-item-margin:0.25rem;--ifm-list-paragraph-margin:1rem;--ifm-table-cell-padding:0.75rem;--ifm-table-background:#0000;--ifm-table-stripe-background:#00000008;--ifm-table-border-width:1px;--ifm-table-border-color:var(--ifm-color-emphasis-300);--ifm-table-head-background:inherit;--ifm-table-head-color:inherit;--ifm-table-head-font-weight:var(--ifm-font-weight-bold);--ifm-table-cell-color:inherit;--ifm-link-color:var(--ifm-color-primary);--ifm-link-decoration:none;--ifm-link-hover-color:var(--ifm-link-color);--ifm-link-hover-decoration:underline;--ifm-paragraph-margin-bottom:var(--ifm-leading);--ifm-blockquote-font-size:var(--ifm-font-size-base);--ifm-blockquote-border-left-width:2px;--ifm-blockquote-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-blockquote-padding-vertical:0;--ifm-blockquote-shadow:none;--ifm-blockquote-color:var(--ifm-color-emphasis-800);--ifm-blockquote-border-color:var(--ifm-color-emphasis-300);--ifm-hr-background-color:var(--ifm-color-emphasis-500);--ifm-hr-height:1px;--ifm-hr-margin-vertical:1.5rem;--ifm-scrollbar-size:7px;--ifm-scrollbar-track-background-color:#f1f1f1;--ifm-scrollbar-thumb-background-color:silver;--ifm-scrollbar-thumb-hover-background-color:#a7a7a7;--ifm-alert-background-color:inherit;--ifm-alert-border-color:inherit;--ifm-alert-border-radius:var(--ifm-global-radius);--ifm-alert-border-width:0px;--ifm-alert-border-left-width:5px;--ifm-alert-color:var(--ifm-font-color-base);--ifm-alert-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-alert-padding-vertical:var(--ifm-spacing-vertical);--ifm-alert-shadow:var(--ifm-global-shadow-lw);--ifm-avatar-intro-margin:1rem;--ifm-avatar-intro-alignment:inherit;--ifm-avatar-photo-size:3rem;--ifm-badge-background-color:inherit;--ifm-badge-border-color:inherit;--ifm-badge-border-radius:var(--ifm-global-radius);--ifm-badge-border-width:var(--ifm-global-border-width);--ifm-badge-color:var(--ifm-color-white);--ifm-badge-padding-horizontal:calc(var(--ifm-spacing-horizontal)*0.5);--ifm-badge-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-breadcrumb-border-radius:1.5rem;--ifm-breadcrumb-spacing:0.5rem;--ifm-breadcrumb-color-active:var(--ifm-color-primary);--ifm-breadcrumb-item-background-active:var(--ifm-hover-overlay);--ifm-breadcrumb-padding-horizontal:0.8rem;--ifm-breadcrumb-padding-vertical:0.4rem;--ifm-breadcrumb-size-multiplier:1;--ifm-breadcrumb-separator:url('data:image/svg+xml;utf8,');--ifm-breadcrumb-separator-filter:none;--ifm-breadcrumb-separator-size:0.5rem;--ifm-breadcrumb-separator-size-multiplier:1.25;--ifm-button-background-color:inherit;--ifm-button-border-color:var(--ifm-button-background-color);--ifm-button-border-width:var(--ifm-global-border-width);--ifm-button-font-weight:var(--ifm-font-weight-bold);--ifm-button-padding-horizontal:1.5rem;--ifm-button-padding-vertical:0.375rem;--ifm-button-size-multiplier:1;--ifm-button-transition-duration:var(--ifm-transition-fast);--ifm-button-border-radius:calc(var(--ifm-global-radius)*var(--ifm-button-size-multiplier));--ifm-button-group-spacing:2px;--ifm-card-background-color:var(--ifm-background-surface-color);--ifm-card-border-radius:calc(var(--ifm-global-radius)*2);--ifm-card-horizontal-spacing:var(--ifm-global-spacing);--ifm-card-vertical-spacing:var(--ifm-global-spacing);--ifm-toc-border-color:var(--ifm-color-emphasis-300);--ifm-toc-link-color:var(--ifm-color-content-secondary);--ifm-toc-padding-vertical:0.5rem;--ifm-toc-padding-horizontal:0.5rem;--ifm-dropdown-background-color:var(--ifm-background-surface-color);--ifm-dropdown-font-weight:var(--ifm-font-weight-semibold);--ifm-dropdown-link-color:var(--ifm-font-color-base);--ifm-dropdown-hover-background-color:var(--ifm-hover-overlay);--ifm-footer-background-color:var(--ifm-color-emphasis-100);--ifm-footer-color:inherit;--ifm-footer-link-color:var(--ifm-color-emphasis-700);--ifm-footer-link-hover-color:var(--ifm-color-primary);--ifm-footer-link-horizontal-spacing:0.5rem;--ifm-footer-padding-horizontal:calc(var(--ifm-spacing-horizontal)*2);--ifm-footer-padding-vertical:calc(var(--ifm-spacing-vertical)*2);--ifm-footer-title-color:inherit;--ifm-hero-background-color:var(--ifm-background-surface-color);--ifm-hero-text-color:var(--ifm-color-emphasis-800);--ifm-menu-color:var(--ifm-color-emphasis-700);--ifm-menu-color-active:var(--ifm-color-primary);--ifm-menu-color-background-active:var(--ifm-hover-overlay);--ifm-menu-color-background-hover:var(--ifm-hover-overlay);--ifm-menu-link-padding-horizontal:0.75rem;--ifm-menu-link-padding-vertical:0.375rem;--ifm-menu-link-sublist-icon:url('data:image/svg+xml;utf8,');--ifm-menu-link-sublist-icon-filter:none;--ifm-navbar-background-color:var(--ifm-background-surface-color);--ifm-navbar-height:3.75rem;--ifm-navbar-item-padding-horizontal:0.75rem;--ifm-navbar-item-padding-vertical:0.25rem;--ifm-navbar-link-color:var(--ifm-font-color-base);--ifm-navbar-link-active-color:var(--ifm-link-color);--ifm-navbar-padding-horizontal:var(--ifm-spacing-horizontal);--ifm-navbar-padding-vertical:calc(var(--ifm-spacing-vertical)*0.5);--ifm-navbar-shadow:var(--ifm-global-shadow-lw);--ifm-navbar-search-input-background-color:var(--ifm-color-emphasis-200);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-800);--ifm-navbar-search-input-placeholder-color:var(--ifm-color-emphasis-500);--ifm-navbar-search-input-icon:url('data:image/svg+xml;utf8,');--ifm-navbar-sidebar-width:83vw;--ifm-pagination-border-radius:var(--ifm-global-radius);--ifm-pagination-color-active:var(--ifm-color-primary);--ifm-pagination-font-size:1rem;--ifm-pagination-item-active-background:var(--ifm-hover-overlay);--ifm-pagination-page-spacing:0.2em;--ifm-pagination-padding-horizontal:calc(var(--ifm-spacing-horizontal)*1);--ifm-pagination-padding-vertical:calc(var(--ifm-spacing-vertical)*0.25);--ifm-pagination-nav-border-radius:var(--ifm-global-radius);--ifm-pagination-nav-color-hover:var(--ifm-color-primary);--ifm-pills-color-active:var(--ifm-color-primary);--ifm-pills-color-background-active:var(--ifm-hover-overlay);--ifm-pills-spacing:0.125rem;--ifm-tabs-color:var(--ifm-font-color-secondary);--ifm-tabs-color-active:var(--ifm-color-primary);--ifm-tabs-color-active-border:var(--ifm-tabs-color-active);--ifm-tabs-padding-horizontal:1rem;--ifm-tabs-padding-vertical:1rem;--docusaurus-progress-bar-color:var(--ifm-color-primary);--ifm-code-font-size:95%;--doc-sidebar-width:330px!important;--ifm-color-content:#172531;--ifm-color-primary:#32accd;--ifm-color-primary-dark:#2d9bb9;--ifm-color-primary-darker:#2a92ae;--ifm-color-primary-darkest:#237890;--ifm-color-primary-light:#47b4d2;--ifm-color-primary-lighter:#51b8d4;--ifm-color-primary-lightest:#70c5dc;--ifm-container-width:1140px;--ifm-table-cell-padding:0.35rem;--ifm-paragraph-margin:0rem;--ifm-font-family-base:-apple-system,BlinkMacSystemFont,"Segoe UI",Oxygen,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif;--docusaurus-tag-list-border:var(--ifm-color-emphasis-300);--docsearch-primary-color:#5468ff;--docsearch-text-color:#1c1e21;--docsearch-spacing:12px;--docsearch-icon-stroke-width:1.4;--docsearch-highlight-color:var(--docsearch-primary-color);--docsearch-muted-color:#969faf;--docsearch-container-background:#656c85cc;--docsearch-logo-color:#5468ff;--docsearch-modal-width:560px;--docsearch-modal-height:600px;--docsearch-modal-background:#f5f6f7;--docsearch-modal-shadow:inset 1px 1px 0 0 #ffffff80,0 3px 8px 0 #555a64;--docsearch-searchbox-height:56px;--docsearch-searchbox-background:#ebedf0;--docsearch-searchbox-focus-background:#fff;--docsearch-searchbox-shadow:inset 0 0 0 2px var(--docsearch-primary-color);--docsearch-hit-height:56px;--docsearch-hit-color:#444950;--docsearch-hit-active-color:#fff;--docsearch-hit-background:#fff;--docsearch-hit-shadow:0 1px 3px 0 #d4d9e1;--docsearch-key-gradient:linear-gradient(-225deg,#d5dbe4,#f8f8f8);--docsearch-key-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 2px 1px #1e235a66;--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #cdcde6,inset 0 0 1px 1px #fff,0 1px 1px 0 #1e235a66;--docsearch-footer-height:44px;--docsearch-footer-background:#fff;--docsearch-footer-shadow:0 -1px 0 0 #e0e3e8,0 -3px 6px 0 #45629b1f;--docsearch-primary-color:var(--ifm-color-primary);--docsearch-text-color:var(--ifm-font-color-base);--docusaurus-announcement-bar-height:auto;--docusaurus-collapse-button-bg:#0000;--docusaurus-collapse-button-bg-hover:#0000001a;--doc-sidebar-width:300px;--doc-sidebar-hidden-width:30px}.badge--danger,.badge--info,.badge--primary,.badge--secondary,.badge--success,.badge--warning{--ifm-badge-border-color:var(--ifm-badge-background-color)}.button--link,.button--outline{--ifm-button-background-color:#0000}html{-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--ifm-background-color);color:var(--ifm-font-color-base);color-scheme:var(--ifm-color-scheme);font:var(--ifm-font-size-base)/var(--ifm-line-height-base) var(--ifm-font-family-base);text-rendering:optimizelegibility}iframe{border:0;color-scheme:auto}.container{margin:0 auto;max-width:var(--ifm-container-width)}.container--fluid{max-width:inherit}.row{display:flex;flex-wrap:wrap;margin:0 calc(var(--ifm-spacing-horizontal)*-1)}.margin-bottom--none,.margin-vert--none,.markdown>:last-child{margin-bottom:0!important}.margin-top--none,.margin-vert--none{margin-top:0!important}.row--no-gutters{margin-left:0;margin-right:0}.margin-horiz--none,.margin-right--none{margin-right:0!important}.row--no-gutters>.col{padding-left:0;padding-right:0}.row--align-top{align-items:flex-start}.row--align-bottom{align-items:flex-end}.menuExternalLink_NmtK,.row--align-center{align-items:center}.row--align-stretch{align-items:stretch}.row--align-baseline{align-items:baseline}.col{--ifm-col-width:100%;flex:1 0;margin-left:0;max-width:var(--ifm-col-width)}.padding-bottom--none,.padding-vert--none{padding-bottom:0!important}.padding-top--none,.padding-vert--none{padding-top:0!important}.padding-horiz--none,.padding-left--none{padding-left:0!important}.padding-horiz--none,.padding-right--none{padding-right:0!important}.col[class*=col--]{flex:0 0 var(--ifm-col-width)}.col--1{--ifm-col-width:8.33333%}.col--offset-1{margin-left:8.33333%}.col--2{--ifm-col-width:16.66667%}.col--offset-2{margin-left:16.66667%}.col--3{--ifm-col-width:25%}.col--offset-3{margin-left:25%}.col--4{--ifm-col-width:33.33333%}.col--offset-4{margin-left:33.33333%}.col--5{--ifm-col-width:41.66667%}.col--offset-5{margin-left:41.66667%}.col--6{--ifm-col-width:50%}.col--offset-6{margin-left:50%}.col--7{--ifm-col-width:58.33333%}.col--offset-7{margin-left:58.33333%}.col--8{--ifm-col-width:66.66667%}.col--offset-8{margin-left:66.66667%}.col--9{--ifm-col-width:75%}.col--offset-9{margin-left:75%}.col--10{--ifm-col-width:83.33333%}.col--offset-10{margin-left:83.33333%}.col--11{--ifm-col-width:91.66667%}.col--offset-11{margin-left:91.66667%}.col--12{--ifm-col-width:100%}.col--offset-12{margin-left:100%}.margin-horiz--none,.margin-left--none{margin-left:0!important}.margin--none{margin:0!important}.margin-bottom--xs,.margin-vert--xs{margin-bottom:.25rem!important}.margin-top--xs,.margin-vert--xs{margin-top:.25rem!important}.margin-horiz--xs,.margin-left--xs{margin-left:.25rem!important}.margin-horiz--xs,.margin-right--xs{margin-right:.25rem!important}.margin--xs{margin:.25rem!important}.margin-bottom--sm,.margin-vert--sm{margin-bottom:.5rem!important}.margin-top--sm,.margin-vert--sm{margin-top:.5rem!important}.margin-horiz--sm,.margin-left--sm{margin-left:.5rem!important}.margin-horiz--sm,.margin-right--sm{margin-right:.5rem!important}.margin--sm{margin:.5rem!important}.margin-bottom--md,.margin-vert--md{margin-bottom:1rem!important}.margin-top--md,.margin-vert--md{margin-top:1rem!important}.margin-horiz--md,.margin-left--md{margin-left:1rem!important}.margin-horiz--md,.margin-right--md{margin-right:1rem!important}.margin--md{margin:1rem!important}.margin-bottom--lg,.margin-vert--lg{margin-bottom:2rem!important}.margin-top--lg,.margin-vert--lg{margin-top:2rem!important}.margin-horiz--lg,.margin-left--lg{margin-left:2rem!important}.margin-horiz--lg,.margin-right--lg{margin-right:2rem!important}.margin--lg{margin:2rem!important}.margin-bottom--xl,.margin-vert--xl{margin-bottom:5rem!important}.margin-top--xl,.margin-vert--xl{margin-top:5rem!important}.margin-horiz--xl,.margin-left--xl{margin-left:5rem!important}.margin-horiz--xl,.margin-right--xl{margin-right:5rem!important}.margin--xl{margin:5rem!important}.padding--none{padding:0!important}.padding-bottom--xs,.padding-vert--xs{padding-bottom:.25rem!important}.padding-top--xs,.padding-vert--xs{padding-top:.25rem!important}.padding-horiz--xs,.padding-left--xs{padding-left:.25rem!important}.padding-horiz--xs,.padding-right--xs{padding-right:.25rem!important}.padding--xs{padding:.25rem!important}.padding-bottom--sm,.padding-vert--sm{padding-bottom:.5rem!important}.padding-top--sm,.padding-vert--sm{padding-top:.5rem!important}.padding-horiz--sm,.padding-left--sm{padding-left:.5rem!important}.padding-horiz--sm,.padding-right--sm{padding-right:.5rem!important}.padding--sm{padding:.5rem!important}.padding-bottom--md,.padding-vert--md{padding-bottom:1rem!important}.padding-horiz--md,.padding-left--md{padding-left:1rem!important}.padding-horiz--md,.padding-right--md{padding-right:1rem!important}.padding--md{padding:1rem!important}.padding-vert--md{padding-top:1rem!important}.padding-bottom--lg,.padding-vert--lg{padding-bottom:2rem!important}.padding-top--lg,.padding-vert--lg{padding-top:2rem!important}.padding-horiz--lg,.padding-left--lg{padding-left:2rem!important}.padding-horiz--lg,.padding-right--lg{padding-right:2rem!important}.padding--lg{padding:2rem!important}.padding-bottom--xl,.padding-vert--xl{padding-bottom:5rem!important}.padding-top--xl,.padding-vert--xl{padding-top:5rem!important}.padding-horiz--xl,.padding-left--xl{padding-left:5rem!important}.padding-horiz--xl,.padding-right--xl{padding-right:5rem!important}.padding--xl{padding:5rem!important}code{background-color:var(--ifm-code-background);border:.1rem solid #0000001a;border-radius:var(--ifm-code-border-radius);font-family:var(--ifm-font-family-monospace);font-size:var(--ifm-code-font-size);padding:var(--ifm-code-padding-vertical) var(--ifm-code-padding-horizontal)}a code{color:inherit;color:var(--ifm-link-color)}pre{background-color:var(--ifm-pre-background);border-radius:var(--ifm-pre-border-radius);color:var(--ifm-pre-color);font:var(--ifm-code-font-size)/var(--ifm-pre-line-height) var(--ifm-font-family-monospace);padding:var(--ifm-pre-padding)}pre code{background-color:initial;border:none;font-size:100%;line-height:inherit;padding:0}kbd{background-color:var(--ifm-color-emphasis-0);border:1px solid var(--ifm-color-emphasis-400);border-radius:.2rem;box-shadow:inset 0 -1px 0 var(--ifm-color-emphasis-400);color:var(--ifm-color-emphasis-800);font:80% var(--ifm-font-family-monospace);padding:.15rem .3rem}h1,h2,h3,h4,h5,h6{color:var(--ifm-heading-color);font-family:var(--ifm-heading-font-family);font-weight:var(--ifm-heading-font-weight);line-height:var(--ifm-heading-line-height);margin:var(--ifm-heading-margin-top) 0 var(--ifm-heading-margin-bottom) 0}h1{font-size:var(--ifm-h1-font-size)}h2{font-size:var(--ifm-h2-font-size)}h3{font-size:var(--ifm-h3-font-size)}h4{font-size:var(--ifm-h4-font-size)}h5{font-size:var(--ifm-h5-font-size)}h6{font-size:var(--ifm-h6-font-size)}img{max-width:100%}img[align=right]{padding-left:var(--image-alignment-padding)}img[align=left]{padding-right:var(--image-alignment-padding)}.markdown{--ifm-h1-vertical-rhythm-top:3;--ifm-h2-vertical-rhythm-top:2;--ifm-h3-vertical-rhythm-top:1.5;--ifm-heading-vertical-rhythm-top:1.25;--ifm-h1-vertical-rhythm-bottom:1.25;--ifm-heading-vertical-rhythm-bottom:1}.markdown:after,.markdown:before{content:"";display:table}.markdown:after{clear:both}.markdown h1:first-child{--ifm-h1-font-size:3rem;margin-bottom:calc(var(--ifm-h1-vertical-rhythm-bottom)*var(--ifm-leading))}.markdown>h2{--ifm-h2-font-size:2rem;margin-top:calc(var(--ifm-h2-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h3{--ifm-h3-font-size:1.5rem;margin-top:calc(var(--ifm-h3-vertical-rhythm-top)*var(--ifm-leading))}.markdown>h4,.markdown>h5,.markdown>h6{margin-top:calc(var(--ifm-heading-vertical-rhythm-top)*var(--ifm-leading))}.markdown>p,.markdown>pre,.markdown>ul{margin-bottom:var(--ifm-leading)}.markdown li>p{margin-top:var(--ifm-list-paragraph-margin)}.markdown li+li{margin-top:var(--ifm-list-item-margin)}ol,ul{margin:0 0 var(--ifm-list-margin);padding-left:var(--ifm-list-left-padding)}ol ol,ul ol{list-style-type:lower-roman}ol ol ol,ol ul ol,ul ol ol,ul ul ol{list-style-type:lower-alpha}table{border-collapse:collapse;display:block;margin-bottom:var(--ifm-spacing-vertical)}table thead tr{border-bottom:2px solid var(--ifm-table-border-color)}table thead,table tr:nth-child(2n){background-color:var(--ifm-table-stripe-background)}table tr{background-color:var(--ifm-table-background);border-top:var(--ifm-table-border-width) solid var(--ifm-table-border-color)}table td,table th{border:var(--ifm-table-border-width) solid var(--ifm-table-border-color);padding:var(--ifm-table-cell-padding)}table th{background-color:var(--ifm-table-head-background);color:var(--ifm-table-head-color);font-weight:var(--ifm-table-head-font-weight)}table td{color:var(--ifm-table-cell-color)}strong{font-weight:var(--ifm-font-weight-bold)}.features_keug h3,article h1,article h2,article h3,article strong,code{font-weight:600}a{color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}a:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button:hover,.text--no-decoration,.text--no-decoration:hover,a:not([href]){text-decoration:none}p{margin:0 0 var(--ifm-paragraph-margin-bottom)}blockquote{border-left:var(--ifm-blockquote-border-left-width) solid var(--ifm-blockquote-border-color);box-shadow:var(--ifm-blockquote-shadow);color:var(--ifm-blockquote-color);font-size:var(--ifm-blockquote-font-size);padding:var(--ifm-blockquote-padding-vertical) var(--ifm-blockquote-padding-horizontal)}blockquote>:first-child{margin-top:0}blockquote>:last-child{margin-bottom:0}hr{background-color:var(--ifm-hr-background-color);border:0;height:var(--ifm-hr-height);margin:var(--ifm-hr-margin-vertical) 0;background-color:#3c3c3c1f}.shadow--lw{box-shadow:var(--ifm-global-shadow-lw)!important}.shadow--md{box-shadow:var(--ifm-global-shadow-md)!important}.shadow--tl{box-shadow:var(--ifm-global-shadow-tl)!important}.text--primary,.wordWrapButtonEnabled_EoeP .wordWrapButtonIcon_Bwma{color:var(--ifm-color-primary)}.text--secondary{color:var(--ifm-color-secondary)}.text--success{color:var(--ifm-color-success)}.text--info{color:var(--ifm-color-info)}.text--warning{color:var(--ifm-color-warning)}.text--danger{color:var(--ifm-color-danger)}.text--center{text-align:center}.text--left{text-align:left}.text--justify{text-align:justify}.text--right{text-align:right}.text--capitalize{text-transform:capitalize}.text--lowercase{text-transform:lowercase}.admonition h5,.alert__heading,.text--uppercase{text-transform:uppercase}.text--light{font-weight:var(--ifm-font-weight-light)}.text--normal{font-weight:var(--ifm-font-weight-normal)}.text--semibold{font-weight:var(--ifm-font-weight-semibold)}.text--bold{font-weight:var(--ifm-font-weight-bold)}.text--italic{font-style:italic}.text--truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text--break{word-wrap:break-word!important;word-break:break-word!important}.clean-btn{background:none;border:none;color:inherit;cursor:pointer;font-family:inherit;padding:0}.alert,.alert .close{color:var(--ifm-alert-foreground-color)}.clean-list{list-style:none;padding-left:0}.alert--primary{--ifm-alert-background-color:var(--ifm-color-primary-contrast-background);--ifm-alert-background-color-highlight:#3578e526;--ifm-alert-foreground-color:var(--ifm-color-primary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-primary-dark)}.alert--secondary{--ifm-alert-background-color:var(--ifm-color-secondary-contrast-background);--ifm-alert-background-color-highlight:#ebedf026;--ifm-alert-foreground-color:var(--ifm-color-secondary-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-secondary-dark)}.alert--success{--ifm-alert-background-color:var(--ifm-color-success-contrast-background);--ifm-alert-background-color-highlight:#00a40026;--ifm-alert-foreground-color:var(--ifm-color-success-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-success-dark)}.alert--info{--ifm-alert-background-color:var(--ifm-color-info-contrast-background);--ifm-alert-background-color-highlight:#54c7ec26;--ifm-alert-foreground-color:var(--ifm-color-info-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-info-dark)}.alert--warning{--ifm-alert-background-color:var(--ifm-color-warning-contrast-background);--ifm-alert-background-color-highlight:#ffba0026;--ifm-alert-foreground-color:var(--ifm-color-warning-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-warning-dark)}.alert--danger{--ifm-alert-background-color:var(--ifm-color-danger-contrast-background);--ifm-alert-background-color-highlight:#fa383e26;--ifm-alert-foreground-color:var(--ifm-color-danger-contrast-foreground);--ifm-alert-border-color:var(--ifm-color-danger-dark)}.alert{--ifm-code-background:var(--ifm-alert-background-color-highlight);--ifm-link-color:var(--ifm-alert-foreground-color);--ifm-link-hover-color:var(--ifm-alert-foreground-color);--ifm-link-decoration:underline;--ifm-tabs-color:var(--ifm-alert-foreground-color);--ifm-tabs-color-active:var(--ifm-alert-foreground-color);--ifm-tabs-color-active-border:var(--ifm-alert-border-color);background-color:var(--ifm-alert-background-color);border:var(--ifm-alert-border-width) solid var(--ifm-alert-border-color);border-left-width:var(--ifm-alert-border-left-width);border-radius:var(--ifm-alert-border-radius);box-shadow:var(--ifm-alert-shadow);padding:var(--ifm-alert-padding-vertical) var(--ifm-alert-padding-horizontal)}.alert__heading{align-items:center;display:flex;font:700 var(--ifm-h5-font-size)/var(--ifm-heading-line-height) var(--ifm-heading-font-family);margin-bottom:.5rem}.alert__icon{display:inline-flex;margin-right:.4em}.alert__icon svg{stroke:var(--ifm-alert-foreground-color);stroke-width:0}.alert .close{margin:calc(var(--ifm-alert-padding-vertical)*-1) calc(var(--ifm-alert-padding-horizontal)*-1) 0 0;opacity:.75}.alert .close:focus,.alert .close:hover{opacity:1}.alert a{text-decoration-color:var(--ifm-alert-border-color)}.alert a:hover{text-decoration-thickness:2px}.avatar{column-gap:var(--ifm-avatar-intro-margin);display:flex}.avatar__photo{border-radius:50%;display:block;height:var(--ifm-avatar-photo-size);overflow:hidden;width:var(--ifm-avatar-photo-size)}.card--full-height,.navbar__logo img,body,html{height:100%}.avatar__photo--sm{--ifm-avatar-photo-size:2rem}.avatar__photo--lg{--ifm-avatar-photo-size:4rem}.avatar__photo--xl{--ifm-avatar-photo-size:6rem}.avatar__intro{display:flex;flex:1 1;flex-direction:column;justify-content:center;text-align:var(--ifm-avatar-intro-alignment)}.badge,.breadcrumbs__item,.breadcrumbs__link,.button,.dropdown>.navbar__link:after{display:inline-block}.avatar__name{font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base)}.avatar__subtitle{margin-top:.25rem}.avatar--vertical{--ifm-avatar-intro-alignment:center;--ifm-avatar-intro-margin:0.5rem;align-items:center;flex-direction:column}.badge{background-color:var(--ifm-badge-background-color);border:var(--ifm-badge-border-width) solid var(--ifm-badge-border-color);border-radius:var(--ifm-badge-border-radius);color:var(--ifm-badge-color);font-size:75%;font-weight:var(--ifm-font-weight-bold);line-height:1;padding:var(--ifm-badge-padding-vertical) var(--ifm-badge-padding-horizontal)}.badge--primary{--ifm-badge-background-color:var(--ifm-color-primary)}.badge--secondary{--ifm-badge-background-color:var(--ifm-color-secondary);color:var(--ifm-color-black)}.breadcrumbs__link,.button.button--secondary.button--outline:not(.button--active):not(:hover){color:var(--ifm-font-color-base)}.badge--success{--ifm-badge-background-color:var(--ifm-color-success)}.badge--info{--ifm-badge-background-color:var(--ifm-color-info)}.badge--warning{--ifm-badge-background-color:var(--ifm-color-warning)}.badge--danger{--ifm-badge-background-color:var(--ifm-color-danger)}.breadcrumbs{margin-bottom:0;padding-left:0}.breadcrumbs__item:not(:last-child):after{background:var(--ifm-breadcrumb-separator) center;content:" ";display:inline-block;filter:var(--ifm-breadcrumb-separator-filter);height:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier));margin:0 var(--ifm-breadcrumb-spacing);opacity:.5;width:calc(var(--ifm-breadcrumb-separator-size)*var(--ifm-breadcrumb-size-multiplier)*var(--ifm-breadcrumb-separator-size-multiplier))}.breadcrumbs__item--active .breadcrumbs__link{background:var(--ifm-breadcrumb-item-background-active);color:var(--ifm-breadcrumb-color-active)}.breadcrumbs__link{border-radius:var(--ifm-breadcrumb-border-radius);font-size:calc(1rem*var(--ifm-breadcrumb-size-multiplier));padding:calc(var(--ifm-breadcrumb-padding-vertical)*var(--ifm-breadcrumb-size-multiplier)) calc(var(--ifm-breadcrumb-padding-horizontal)*var(--ifm-breadcrumb-size-multiplier));transition-duration:var(--ifm-transition-fast);transition-property:background,color}.breadcrumbs__link:hover{background:var(--ifm-breadcrumb-item-background-active);text-decoration:none}.breadcrumbs--sm{--ifm-breadcrumb-size-multiplier:0.8}.breadcrumbs--lg{--ifm-breadcrumb-size-multiplier:1.2}.button{background-color:var(--ifm-button-background-color);border:var(--ifm-button-border-width) solid var(--ifm-button-border-color);border-radius:var(--ifm-button-border-radius);cursor:pointer;font-size:calc(.875rem*var(--ifm-button-size-multiplier));font-weight:var(--ifm-button-font-weight);line-height:1.5;padding:calc(var(--ifm-button-padding-vertical)*var(--ifm-button-size-multiplier)) calc(var(--ifm-button-padding-horizontal)*var(--ifm-button-size-multiplier));text-align:center;transition-duration:var(--ifm-button-transition-duration);transition-property:color,background,border-color;-webkit-user-select:none;user-select:none;white-space:nowrap}.button,.button:hover{color:var(--ifm-button-color)}.button--outline{--ifm-button-color:var(--ifm-button-border-color)}.button--outline:hover{--ifm-button-background-color:var(--ifm-button-border-color)}.button--link{--ifm-button-border-color:#0000;color:var(--ifm-link-color);text-decoration:var(--ifm-link-decoration)}.button--link.button--active,.button--link:active,.button--link:hover{color:var(--ifm-link-hover-color);text-decoration:var(--ifm-link-hover-decoration)}.button.disabled,.button:disabled,.button[disabled]{opacity:.65;pointer-events:none}.button--sm{--ifm-button-size-multiplier:0.8}.button--lg{--ifm-button-size-multiplier:1.35}.button--block{display:block;width:100%}.button.button--secondary{color:var(--ifm-color-gray-900)}:where(.button--primary){--ifm-button-background-color:var(--ifm-color-primary);--ifm-button-border-color:var(--ifm-color-primary)}:where(.button--primary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-primary-dark);--ifm-button-border-color:var(--ifm-color-primary-dark)}.button--primary.button--active,.button--primary:active{--ifm-button-background-color:var(--ifm-color-primary-darker);--ifm-button-border-color:var(--ifm-color-primary-darker)}:where(.button--secondary){--ifm-button-background-color:var(--ifm-color-secondary);--ifm-button-border-color:var(--ifm-color-secondary)}:where(.button--secondary):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-secondary-dark);--ifm-button-border-color:var(--ifm-color-secondary-dark)}.button--secondary.button--active,.button--secondary:active{--ifm-button-background-color:var(--ifm-color-secondary-darker);--ifm-button-border-color:var(--ifm-color-secondary-darker)}:where(.button--success){--ifm-button-background-color:var(--ifm-color-success);--ifm-button-border-color:var(--ifm-color-success)}:where(.button--success):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-success-dark);--ifm-button-border-color:var(--ifm-color-success-dark)}.button--success.button--active,.button--success:active{--ifm-button-background-color:var(--ifm-color-success-darker);--ifm-button-border-color:var(--ifm-color-success-darker)}:where(.button--info){--ifm-button-background-color:var(--ifm-color-info);--ifm-button-border-color:var(--ifm-color-info)}:where(.button--info):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-info-dark);--ifm-button-border-color:var(--ifm-color-info-dark)}.button--info.button--active,.button--info:active{--ifm-button-background-color:var(--ifm-color-info-darker);--ifm-button-border-color:var(--ifm-color-info-darker)}:where(.button--warning){--ifm-button-background-color:var(--ifm-color-warning);--ifm-button-border-color:var(--ifm-color-warning)}:where(.button--warning):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-warning-dark);--ifm-button-border-color:var(--ifm-color-warning-dark)}.button--warning.button--active,.button--warning:active{--ifm-button-background-color:var(--ifm-color-warning-darker);--ifm-button-border-color:var(--ifm-color-warning-darker)}:where(.button--danger){--ifm-button-background-color:var(--ifm-color-danger);--ifm-button-border-color:var(--ifm-color-danger)}:where(.button--danger):not(.button--outline):hover{--ifm-button-background-color:var(--ifm-color-danger-dark);--ifm-button-border-color:var(--ifm-color-danger-dark)}.button--danger.button--active,.button--danger:active{--ifm-button-background-color:var(--ifm-color-danger-darker);--ifm-button-border-color:var(--ifm-color-danger-darker)}.button-group{display:inline-flex;gap:var(--ifm-button-group-spacing)}.button-group>.button:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.button-group>.button:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.button-group--block{display:flex;justify-content:stretch}.button-group--block>.button{flex-grow:1}.card{background-color:var(--ifm-card-background-color);border-radius:var(--ifm-card-border-radius);box-shadow:var(--ifm-global-shadow-lw);display:flex;flex-direction:column;overflow:hidden}.card__image{padding-top:var(--ifm-card-vertical-spacing)}.card__image:first-child{padding-top:0}.card__body,.card__footer,.card__header{padding:var(--ifm-card-vertical-spacing) var(--ifm-card-horizontal-spacing)}.card__body:not(:last-child),.card__footer:not(:last-child),.card__header:not(:last-child){padding-bottom:0}.card__body>:last-child,.card__footer>:last-child,.card__header>:last-child{margin-bottom:0}.card__footer{margin-top:auto}.table-of-contents{font-size:.8rem;margin-bottom:0;padding:var(--ifm-toc-padding-vertical) 0}.table-of-contents,.table-of-contents ul{list-style:none;padding-left:var(--ifm-toc-padding-horizontal)}.table-of-contents li{margin:var(--ifm-toc-padding-vertical) var(--ifm-toc-padding-horizontal)}.table-of-contents__left-border{border-left:1px solid var(--ifm-toc-border-color)}.table-of-contents__link{color:var(--ifm-toc-link-color);display:block}.table-of-contents__link--active,.table-of-contents__link--active code,.table-of-contents__link:hover,.table-of-contents__link:hover code{color:var(--ifm-color-primary);text-decoration:none}.close{color:var(--ifm-color-black);float:right;font-size:1.5rem;font-weight:var(--ifm-font-weight-bold);line-height:1;opacity:.5;padding:1rem;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.close:hover{opacity:.7}.close:focus,.theme-code-block-highlighted-line .codeLineNumber_Tfdd:before{opacity:.8}.dropdown{display:inline-flex;font-weight:var(--ifm-dropdown-font-weight);position:relative;vertical-align:top}.dropdown--hoverable:hover .dropdown__menu,.dropdown--show .dropdown__menu{opacity:1;pointer-events:all;transform:translateY(0);visibility:visible}#nprogress,.dropdown__menu,.navbar__item.dropdown .navbar__link:not([href]){pointer-events:none}.dropdown--right .dropdown__menu{left:inherit;right:0}.dropdown--nocaret .navbar__link:after{content:none!important}.dropdown__menu{background-color:var(--ifm-dropdown-background-color);border-radius:var(--ifm-global-radius);box-shadow:var(--ifm-global-shadow-md);left:0;list-style:none;max-height:80vh;min-width:10rem;opacity:0;overflow-y:auto;padding:.5rem;position:absolute;top:calc(100% - var(--ifm-navbar-item-padding-vertical) + .3rem);transform:translateY(-.625rem);transition-duration:var(--ifm-transition-fast);transition-property:opacity,transform,visibility;transition-timing-function:var(--ifm-transition-timing-default);visibility:hidden;z-index:var(--ifm-z-index-dropdown)}.menu__caret,.menu__link,.menu__list-item-collapsible{border-radius:.25rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.dropdown__link{border-radius:.25rem;color:var(--ifm-dropdown-link-color);display:block;font-size:.875rem;margin-top:.2rem;padding:.25rem .5rem;white-space:nowrap}.dropdown__link--active,.dropdown__link:hover{background-color:var(--ifm-dropdown-hover-background-color);color:var(--ifm-dropdown-link-color);text-decoration:none}.dropdown__link--active,.dropdown__link--active:hover{--ifm-dropdown-link-color:var(--ifm-link-color)}.dropdown>.navbar__link:after{border-color:currentcolor #0000;border-style:solid;border-width:.4em .4em 0;content:"";margin-left:.3em;position:relative;top:2px;transform:translateY(-50%)}.footer{background-color:var(--ifm-footer-background-color);color:var(--ifm-footer-color);padding:var(--ifm-footer-padding-vertical) var(--ifm-footer-padding-horizontal)}.footer--dark{--ifm-footer-background-color:#303846;--ifm-footer-color:var(--ifm-footer-link-color);--ifm-footer-link-color:var(--ifm-color-secondary);--ifm-footer-title-color:var(--ifm-color-white)}.footer__links{margin-bottom:1rem}.footer__link-item{color:var(--ifm-footer-link-color);line-height:2}.footer__link-item:hover{color:var(--ifm-footer-link-hover-color)}.footer__link-separator{margin:0 var(--ifm-footer-link-horizontal-spacing)}.footer__logo{margin-top:1rem;max-width:10rem}.footer__title{color:var(--ifm-footer-title-color);font:700 var(--ifm-h4-font-size)/var(--ifm-heading-line-height) var(--ifm-font-family-base);margin-bottom:var(--ifm-heading-margin-bottom)}.menu,.navbar__link{font-weight:var(--ifm-font-weight-semibold)}.docItemContainer_Adtb article>:first-child,.docItemContainer_Adtb header+*,.footer__item{margin-top:0}.admonition-content>:last-child,.collapsibleContent_i85q>:last-child,.footer__items{margin-bottom:0}.codeBlockStandalone_MEMb,[type=checkbox]{padding:0}.hero{align-items:center;background-color:var(--ifm-hero-background-color);color:var(--ifm-hero-text-color);display:flex;padding:4rem 2rem}.hero--primary{--ifm-hero-background-color:var(--ifm-color-primary);--ifm-hero-text-color:var(--ifm-font-color-base-inverse)}.hero--dark{--ifm-hero-background-color:#303846;--ifm-hero-text-color:var(--ifm-color-white)}.hero__title{font-size:3rem}.hero__subtitle{font-size:1.5rem}.menu__list{list-style:none;margin:0;padding-left:0}.menu__caret,.menu__link{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu__list .menu__list{flex:0 0 100%;margin-top:.25rem;padding-left:var(--ifm-menu-link-padding-horizontal)}.menu__list-item:not(:first-child){margin-top:.25rem}.menu__list-item--collapsed .menu__list{height:0;overflow:hidden}.details_lb9f[data-collapsed=false].isBrowser_bmU9>summary:before,.details_lb9f[open]:not(.isBrowser_bmU9)>summary:before,.menu__list-item--collapsed .menu__caret:before,.menu__list-item--collapsed .menu__link--sublist:after{transform:rotate(90deg)}.menu__list-item-collapsible{display:flex;flex-wrap:wrap;position:relative}.menu__caret:hover,.menu__link:hover,.menu__list-item-collapsible--active,.menu__list-item-collapsible:hover{background:var(--ifm-menu-color-background-hover)}.menu__list-item-collapsible .menu__link--active,.menu__list-item-collapsible .menu__link:hover{background:none!important}.menu__caret,.menu__link{align-items:center;display:flex}.navbar-sidebar,.navbar-sidebar__backdrop{bottom:0;opacity:0;transition-timing-function:ease-in-out;top:0;left:0;visibility:hidden}.menu__link{color:var(--ifm-menu-color);flex:1;line-height:1.25}.menu__link:hover{color:var(--ifm-menu-color);text-decoration:none}.menu__caret:before,.menu__link--sublist-caret:after{height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast) linear;width:1.25rem;content:"";filter:var(--ifm-menu-link-sublist-icon-filter)}.menu__link--sublist-caret:after{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem;margin-left:auto;min-width:1.25rem}.menu__link--active,.menu__link--active:hover{color:var(--ifm-menu-color-active)}.navbar__brand,.navbar__link{color:var(--ifm-navbar-link-color)}.menu__link--active:not(.menu__link--sublist){background-color:var(--ifm-menu-color-background-active)}.menu__caret:before{background:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem}.navbar--dark,html[data-theme=dark]{--ifm-menu-link-sublist-icon-filter:invert(100%) sepia(94%) saturate(17%) hue-rotate(223deg) brightness(104%) contrast(98%)}.navbar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-navbar-shadow);height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar,.navbar>.container,.navbar>.container-fluid{display:flex}.navbar--fixed-top{position:sticky;top:0;z-index:var(--ifm-z-index-fixed)}.navbar__inner{display:flex;flex-wrap:wrap;justify-content:space-between;width:100%}.navbar__brand{align-items:center;display:flex;margin-right:1rem;min-width:0}.navbar__brand:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar__title{flex:1 1 auto}.navbar__toggle{display:none;margin-right:.5rem}.navbar__logo{flex:0 0 auto;height:2rem;margin-right:.5rem}.navbar__items{align-items:center;display:flex;flex:1;min-width:0}.navbar__items--center{flex:0 0 auto}.navbar__items--center .navbar__brand{margin:0}.navbar__items--center+.navbar__items--right{flex:1}.navbar__items--right{flex:0 0 auto;justify-content:flex-end}.navbar__items--right>:last-child{padding-right:0}.navbar__item{display:inline-block;padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.navbar__link--active,.navbar__link:hover{color:var(--ifm-navbar-link-hover-color);text-decoration:none}.navbar--dark,.navbar--primary{--ifm-menu-color:var(--ifm-color-gray-300);--ifm-navbar-link-color:var(--ifm-color-gray-100);--ifm-navbar-search-input-background-color:#ffffff1a;--ifm-navbar-search-input-placeholder-color:#ffffff80;color:var(--ifm-color-white)}.navbar--dark{--ifm-navbar-background-color:#242526;--ifm-menu-color-background-active:#ffffff0d;--ifm-navbar-search-input-color:var(--ifm-color-white)}.navbar--primary{--ifm-navbar-background-color:var(--ifm-color-primary);--ifm-navbar-link-hover-color:var(--ifm-color-white);--ifm-menu-color-active:var(--ifm-color-white);--ifm-navbar-search-input-color:var(--ifm-color-emphasis-500)}.navbar__search-input{appearance:none;background:var(--ifm-navbar-search-input-background-color) var(--ifm-navbar-search-input-icon) no-repeat .75rem center/1rem 1rem;border:none;border-radius:2rem;color:var(--ifm-navbar-search-input-color);cursor:text;display:inline-block;font-size:.9rem;height:2rem;padding:0 .5rem 0 2.25rem;width:12.5rem}.navbar__search-input::placeholder{color:var(--ifm-navbar-search-input-placeholder-color)}.navbar-sidebar{background-color:var(--ifm-navbar-background-color);box-shadow:var(--ifm-global-shadow-md);position:fixed;transform:translate3d(-100%,0,0);transition-duration:.25s;transition-property:opacity,visibility,transform;width:var(--ifm-navbar-sidebar-width)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar__items{transform:translateZ(0)}.navbar-sidebar--show .navbar-sidebar,.navbar-sidebar--show .navbar-sidebar__backdrop{opacity:1;visibility:visible}.navbar-sidebar__backdrop{background-color:#0009;position:fixed;right:0;transition-duration:.1s;transition-property:opacity,visibility}.navbar-sidebar__brand{align-items:center;box-shadow:var(--ifm-navbar-shadow);display:flex;flex:1;height:var(--ifm-navbar-height);padding:var(--ifm-navbar-padding-vertical) var(--ifm-navbar-padding-horizontal)}.navbar-sidebar__items{display:flex;height:calc(100% - var(--ifm-navbar-height));transition:transform var(--ifm-transition-fast) ease-in-out}.navbar-sidebar__items--show-secondary{transform:translate3d(calc((var(--ifm-navbar-sidebar-width))*-1),0,0)}.navbar-sidebar__item{flex-shrink:0;padding:.5rem;width:calc(var(--ifm-navbar-sidebar-width))}.navbar-sidebar__back{background:var(--ifm-menu-color-background-active);font-size:15px;font-weight:var(--ifm-button-font-weight);margin:0 0 .2rem -.5rem;padding:.6rem 1.5rem;position:relative;text-align:left;top:-.5rem;width:calc(100% + 1rem)}.navbar-sidebar__close{display:flex;margin-left:auto}.pagination{column-gap:var(--ifm-pagination-page-spacing);display:flex;font-size:var(--ifm-pagination-font-size);padding-left:0}.pagination--sm{--ifm-pagination-font-size:0.8rem;--ifm-pagination-padding-horizontal:0.8rem;--ifm-pagination-padding-vertical:0.2rem}.pagination--lg{--ifm-pagination-font-size:1.2rem;--ifm-pagination-padding-horizontal:1.2rem;--ifm-pagination-padding-vertical:0.3rem}.pagination__item{display:inline-flex}.pagination__item>span{padding:var(--ifm-pagination-padding-vertical)}.pagination__item--active .pagination__link{color:var(--ifm-pagination-color-active)}.pagination__item--active .pagination__link,.pagination__item:not(.pagination__item--active):hover .pagination__link{background:var(--ifm-pagination-item-active-background)}.pagination__item--disabled,.pagination__item[disabled]{opacity:.25;pointer-events:none}.pagination__link{border-radius:var(--ifm-pagination-border-radius);color:var(--ifm-font-color-base);display:inline-block;padding:var(--ifm-pagination-padding-vertical) var(--ifm-pagination-padding-horizontal);transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination__link:hover{text-decoration:none}.pagination-nav{grid-gap:var(--ifm-spacing-horizontal);display:grid;gap:var(--ifm-spacing-horizontal);grid-template-columns:repeat(2,1fr)}.pagination-nav__link{border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-pagination-nav-border-radius);display:block;height:100%;line-height:var(--ifm-heading-line-height);padding:var(--ifm-global-spacing);transition:border-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.pagination-nav__link:hover{border-color:var(--ifm-pagination-nav-color-hover);text-decoration:none}.pagination-nav__link--next{grid-column:2/3;text-align:right}.pagination-nav__label{font-size:var(--ifm-h4-font-size);font-weight:var(--ifm-heading-font-weight);word-break:break-word}.pagination-nav__link--prev .pagination-nav__label:before{content:"« "}.pagination-nav__link--next .pagination-nav__label:after{content:" »"}.pagination-nav__sublabel{color:var(--ifm-color-content-secondary);font-size:var(--ifm-h5-font-size);font-weight:var(--ifm-font-weight-semibold);margin-bottom:.25rem}.pills__item,.tabs{font-weight:var(--ifm-font-weight-bold)}.pills{display:flex;gap:var(--ifm-pills-spacing);padding-left:0}.pills__item{border-radius:.5rem;cursor:pointer;display:inline-block;padding:.25rem 1rem;transition:background var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs,:not(.containsTaskList_mC6p>li)>.containsTaskList_mC6p{padding-left:0}.pills__item--active{color:var(--ifm-pills-color-active)}.pills__item--active,.pills__item:not(.pills__item--active):hover{background:var(--ifm-pills-color-background-active)}.pills--block{justify-content:stretch}.pills--block .pills__item{flex-grow:1;text-align:center}.tabs{color:var(--ifm-tabs-color);display:flex;margin-bottom:0;overflow-x:auto}.tabs__item{border-bottom:3px solid #0000;border-radius:var(--ifm-global-radius);cursor:pointer;display:inline-flex;padding:var(--ifm-tabs-padding-vertical) var(--ifm-tabs-padding-horizontal);transition:background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.tabs__item--active{border-bottom-color:var(--ifm-tabs-color-active-border);border-bottom-left-radius:0;border-bottom-right-radius:0;color:var(--ifm-tabs-color-active)}.tabs__item:hover{background-color:var(--ifm-hover-overlay)}.tabs--block{justify-content:stretch}.tabs--block .tabs__item{flex-grow:1;justify-content:center}html[data-theme=dark]{--ifm-color-scheme:dark;--ifm-color-emphasis-0:var(--ifm-color-gray-1000);--ifm-color-emphasis-100:var(--ifm-color-gray-900);--ifm-color-emphasis-200:var(--ifm-color-gray-800);--ifm-color-emphasis-300:var(--ifm-color-gray-700);--ifm-color-emphasis-400:var(--ifm-color-gray-600);--ifm-color-emphasis-600:var(--ifm-color-gray-400);--ifm-color-emphasis-700:var(--ifm-color-gray-300);--ifm-color-emphasis-800:var(--ifm-color-gray-200);--ifm-color-emphasis-900:var(--ifm-color-gray-100);--ifm-color-emphasis-1000:var(--ifm-color-gray-0);--ifm-background-color:#1b1b1d;--ifm-background-surface-color:#242526;--ifm-hover-overlay:#ffffff0d;--ifm-color-content:#e3e3e3;--ifm-color-content-secondary:#fff;--ifm-breadcrumb-separator-filter:invert(64%) sepia(11%) saturate(0%) hue-rotate(149deg) brightness(99%) contrast(95%);--ifm-code-background:#ffffff1a;--ifm-scrollbar-track-background-color:#444;--ifm-scrollbar-thumb-background-color:#686868;--ifm-scrollbar-thumb-hover-background-color:#7a7a7a;--ifm-table-stripe-background:#ffffff12;--ifm-toc-border-color:var(--ifm-color-emphasis-200);--ifm-color-primary-contrast-background:#102445;--ifm-color-primary-contrast-foreground:#ebf2fc;--ifm-color-secondary-contrast-background:#474748;--ifm-color-secondary-contrast-foreground:#fdfdfe;--ifm-color-success-contrast-background:#003100;--ifm-color-success-contrast-foreground:#e6f6e6;--ifm-color-info-contrast-background:#193c47;--ifm-color-info-contrast-foreground:#eef9fd;--ifm-color-warning-contrast-background:#4d3800;--ifm-color-warning-contrast-foreground:#fff8e6;--ifm-color-danger-contrast-background:#4b1113;--ifm-color-danger-contrast-foreground:#ffebec;--docsearch-text-color:#f5f6f7;--docsearch-container-background:#090a11cc;--docsearch-modal-background:#15172a;--docsearch-modal-shadow:inset 1px 1px 0 0 #2c2e40,0 3px 8px 0 #000309;--docsearch-searchbox-background:#090a11;--docsearch-searchbox-focus-background:#000;--docsearch-hit-color:#bec3c9;--docsearch-hit-shadow:none;--docsearch-hit-background:#090a11;--docsearch-key-gradient:linear-gradient(-26.5deg,#565872,#31355b);--docsearch-key-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 2px 2px 0 #0304094d;--docsearch-key-pressed-shadow:inset 0 -2px 0 0 #282d55,inset 0 0 1px 1px #51577d,0 1px 1px 0 #0304094d;--docsearch-footer-background:#1e2136;--docsearch-footer-shadow:inset 0 1px 0 0 #494c6a80,0 -4px 8px 0 #0003;--docsearch-logo-color:#fff;--docsearch-muted-color:#7f8497}.admonition h5{margin-bottom:8px;margin-top:0}.admonition h5 code{text-transform:none}.admonition-icon{display:inline-block;margin-right:.4em;vertical-align:middle}.admonition-icon svg{stroke-width:0;stroke:var(--ifm-alert-foreground-color);display:inline-block;height:22px;width:22px}.admonition{margin-bottom:1em}#nprogress .bar{background:var(--docusaurus-progress-bar-color);height:2px;left:0;position:fixed;top:0;width:100%;z-index:1031}#nprogress .peg{box-shadow:0 0 10px var(--docusaurus-progress-bar-color),0 0 5px var(--docusaurus-progress-bar-color);height:100%;opacity:1;position:absolute;right:0;transform:rotate(3deg) translateY(-4px);width:100px}:root .prism-code{--ifm-code-font-size:85%}[data-theme=dark]{--ifm-color-primary:#32accd;--ifm-color-primary-dark:#2d9bb9;--ifm-color-primary-darker:#2a92ae;--ifm-color-primary-darkest:#237890;--ifm-color-primary-light:#47b4d2;--ifm-color-primary-lighter:#51b8d4;--ifm-color-primary-lightest:#70c5dc}.padding-top--md{padding-top:32px!important}article{max-width:730px}article h1{font-size:32px!important}article h1 code{font-size:30px!important}article h2{border-top:1px solid #3c3c3c1f;font-size:24px!important;letter-spacing:-.02em;margin:48px 0 16px;padding-top:24px}[data-theme=dark] article h2{border-top:1px solid #5454547a}article h2 code{font-size:22px!important}article h3{font-size:20px!important}article h3 code{font-size:18px!important}.navbar .navbar__items{flex:auto}[data-theme=dark] hr{background-color:#5454547a}code{border:none;border-radius:4px;color:var(--ifm-color-gray-800);font-family:monospace,Courier New,Courier;padding:3px 6px}[data-theme=dark] code{color:var(--ifm-color-gray-200)}#header-animation-canvas{height:100%;position:absolute;top:0;width:100%;z-index:-1}#sub-title,#title{color:#323330;font-family:circular,Segoe UI,sans-serif,Tahoma,Geneva,Verdana;text-shadow:1px 1px 1px #d1b73d}#learn-more{-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);color:#323330}#header-container{word-wrap:normal;display:flex}#left-header-section{flex:2;margin-top:8%}#css-animated-bg-container{background:linear-gradient(#ffe53b,#dac540);border-bottom:1px solid #000;padding-bottom:0;padding-top:16px}.iconEdit_eYIM{margin-right:.3em;vertical-align:sub}.tag_zVej{border:1px solid var(--docusaurus-tag-list-border);transition:border var(--ifm-transition-fast)}.tag_zVej:hover{--docusaurus-tag-list-border:var(--ifm-link-color);text-decoration:none}.tagRegular_sFm0{border-radius:.5rem;font-size:90%;padding:.3rem .5rem}.tagWithCount_h2kH{align-items:center;border-left:0;display:flex;padding:0 .5rem 0 1rem;position:relative}.tagWithCount_h2kH:after,.tagWithCount_h2kH:before{border:1px solid var(--docusaurus-tag-list-border);content:"";position:absolute;top:50%;transition:inherit}.tagWithCount_h2kH:before{border-bottom:0;border-right:0;height:1.18rem;right:100%;transform:translate(50%,-50%) rotate(-45deg);width:1.18rem}.tagWithCount_h2kH:after{border-radius:50%;height:.5rem;left:0;transform:translateY(-50%);width:.5rem}.tagWithCount_h2kH span{background:var(--ifm-color-secondary);border-radius:var(--ifm-global-radius);color:var(--ifm-color-black);font-size:.7rem;line-height:1.2;margin-left:.3rem;padding:.1rem .4rem}.tags_jXut{display:inline}.tag_QGVx{display:inline-block;margin:0 .4rem .5rem 0}.lastUpdated_vbeJ{font-size:smaller;font-style:italic;margin-top:.2rem}.DocSearch-Button{align-items:center;background:var(--docsearch-searchbox-background);border:0;border-radius:40px;color:var(--docsearch-muted-color);cursor:pointer;display:flex;font-weight:500;height:36px;justify-content:space-between;padding:0 8px;-webkit-user-select:none;user-select:none}.DocSearch-Button:active,.DocSearch-Button:focus,.DocSearch-Button:hover{background:var(--docsearch-searchbox-focus-background);box-shadow:var(--docsearch-searchbox-shadow);color:var(--docsearch-text-color);outline:0}.DocSearch-Button-Container{align-items:center;display:flex}.DocSearch-Search-Icon{stroke-width:1.6}.DocSearch-Hit-Tree,.DocSearch-Hit-action,.DocSearch-Hit-icon,.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width)}.DocSearch-Button .DocSearch-Search-Icon{color:var(--docsearch-text-color)}.DocSearch-Button-Placeholder{font-size:1rem;padding:0 12px 0 6px}.DocSearch-Button-Keys{display:flex;min-width:calc(40px + .8em)}.DocSearch-Button-Key{align-items:center;background:var(--docsearch-key-gradient);border:0;border-radius:3px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);display:flex;height:18px;justify-content:center;margin-right:.4em;padding:0 0 2px;position:relative;top:-1px;width:20px}.DocSearch-Button-Key--pressed{box-shadow:var(--docsearch-key-pressed-shadow);transform:translate3d(0,1px,0)}.DocSearch--active{overflow:hidden!important}.DocSearch-Container{background-color:var(--docsearch-container-background);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:200}.DocSearch-Container a{text-decoration:none}.DocSearch-Link{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;font:inherit;margin:0;padding:0}.DocSearch-Modal{background:var(--docsearch-modal-background);border-radius:6px;box-shadow:var(--docsearch-modal-shadow);flex-direction:column;margin:60px auto auto;max-width:var(--docsearch-modal-width);position:relative}.DocSearch-SearchBar{display:flex;padding:var(--docsearch-spacing) var(--docsearch-spacing) 0}.DocSearch-Form{align-items:center;background:var(--docsearch-searchbox-focus-background);border-radius:4px;box-shadow:var(--docsearch-searchbox-shadow);display:flex;height:var(--docsearch-searchbox-height);margin:0;padding:0 var(--docsearch-spacing);position:relative;width:100%}.DocSearch-Input{appearance:none;background:#0000;border:0;color:var(--docsearch-text-color);flex:1;font:inherit;font-size:1.2em;height:100%;outline:0;padding:0 0 0 8px;width:80%}.DocSearch-Input::placeholder{color:var(--docsearch-muted-color);opacity:1}.DocSearch-Input::-webkit-search-cancel-button,.DocSearch-Input::-webkit-search-decoration,.DocSearch-Input::-webkit-search-results-button,.DocSearch-Input::-webkit-search-results-decoration{display:none}.DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{margin:0;padding:0}.DocSearch-Container--Stalled .DocSearch-LoadingIndicator,.DocSearch-MagnifierLabel,.DocSearch-Reset{align-items:center;color:var(--docsearch-highlight-color);display:flex;justify-content:center}.DocSearch-Cancel,.DocSearch-Container--Stalled .DocSearch-MagnifierLabel,.DocSearch-LoadingIndicator,.DocSearch-Reset[hidden]{display:none}.DocSearch-Reset{animation:.1s ease-in forwards a;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;padding:2px;right:0}.DocSearch-Help,.DocSearch-HitsFooter,.DocSearch-Label{color:var(--docsearch-muted-color)}.DocSearch-Reset:hover{color:var(--docsearch-highlight-color)}.DocSearch-LoadingIndicator svg,.DocSearch-MagnifierLabel svg{height:24px;width:24px}.DocSearch-Dropdown{max-height:calc(var(--docsearch-modal-height) - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height));min-height:var(--docsearch-spacing);overflow-y:auto;overflow-y:overlay;padding:0 var(--docsearch-spacing);scrollbar-color:var(--docsearch-muted-color) var(--docsearch-modal-background);scrollbar-width:thin}.DocSearch-Dropdown::-webkit-scrollbar{width:12px}.DocSearch-Dropdown::-webkit-scrollbar-track{background:#0000}.DocSearch-Dropdown::-webkit-scrollbar-thumb{background-color:var(--docsearch-muted-color);border:3px solid var(--docsearch-modal-background);border-radius:20px}.DocSearch-Dropdown ul{list-style:none;margin:0;padding:0}.DocSearch-Label{font-size:.75em;line-height:1.6em}.DocSearch-Help{font-size:.9em;margin:0;-webkit-user-select:none;user-select:none}.DocSearch-Title{font-size:1.2em}.DocSearch-Logo a,.docsWrapper_BCFX{display:flex}.DocSearch-Logo svg{color:var(--docsearch-logo-color);margin-left:8px}.DocSearch-Hits:last-of-type{margin-bottom:24px}.DocSearch-Hits mark{background:none;color:var(--docsearch-highlight-color)}.DocSearch-HitsFooter{display:flex;font-size:.85em;justify-content:center;margin-bottom:var(--docsearch-spacing);padding:var(--docsearch-spacing)}.DocSearch-HitsFooter a{border-bottom:1px solid;color:inherit}.DocSearch-Hit{border-radius:4px;display:flex;padding-bottom:4px;position:relative}.DocSearch-Hit--deleting{opacity:0;transition:.25s linear}.DocSearch-Hit--favoriting{transform:scale(0);transform-origin:top center;transition:.25s linear .25s}.DocSearch-Hit a{background:var(--docsearch-hit-background);border-radius:4px;box-shadow:var(--docsearch-hit-shadow);display:block;padding-left:var(--docsearch-spacing);width:100%}.DocSearch-Hit-source{background:var(--docsearch-modal-background);color:var(--docsearch-highlight-color);font-size:.85em;font-weight:600;line-height:32px;margin:0 -4px;padding:8px 4px 0;position:sticky;top:0;z-index:10}.DocSearch-Hit-Tree{color:var(--docsearch-muted-color);height:var(--docsearch-hit-height);opacity:.5;width:24px}.DocSearch-Hit[aria-selected=true] a{background-color:var(--docsearch-highlight-color)}.DocSearch-Hit[aria-selected=true] mark{text-decoration:underline}.DocSearch-Hit-Container{align-items:center;color:var(--docsearch-hit-color);display:flex;flex-direction:row;height:var(--docsearch-hit-height);padding:0 var(--docsearch-spacing) 0 0}.DocSearch-Hit-icon{height:20px;width:20px}.DocSearch-Hit-action,.DocSearch-Hit-icon{color:var(--docsearch-muted-color)}.DocSearch-Hit-action{align-items:center;display:flex;height:22px;width:22px}.DocSearch-Hit-action svg{display:block;height:18px;width:18px}.DocSearch-Hit-action+.DocSearch-Hit-action{margin-left:6px}.DocSearch-Hit-action-button{appearance:none;background:none;border:0;border-radius:50%;color:inherit;cursor:pointer;padding:2px}#docusaurus-base-url-issue-banner-container,.collapseSidebarButton_PEFL,.docSidebarContainer_b6E3,.sidebarLogo_isFc,.themedImage_ToTc,[data-theme=dark] .lightToggleIcon_pyhR,[data-theme=light] .darkToggleIcon_wfgR,html[data-announcement-bar-initially-dismissed=true] .announcementBar_mb4j,svg.DocSearch-Hit-Select-Icon{display:none}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Select-Icon,.tocCollapsibleContent_vkbj a{display:block}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:background-color .1s ease-in}.DocSearch-Hit-action-button:focus path,.DocSearch-Hit-action-button:hover path{fill:#fff}.DocSearch-Hit-content-wrapper{display:flex;flex:1 1 auto;flex-direction:column;font-weight:500;justify-content:center;line-height:1.2em;margin:0 8px;overflow-x:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap;width:80%}.DocSearch-Hit-title{font-size:.9em}.DocSearch-Hit-path{color:var(--docsearch-muted-color);font-size:.75em}.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-Tree,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-action,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-icon,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-path,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-text,.DocSearch-Hit[aria-selected=true] .DocSearch-Hit-title,.DocSearch-Hit[aria-selected=true] mark{color:var(--docsearch-hit-active-color)!important}.DocSearch-ErrorScreen,.DocSearch-NoResults,.DocSearch-StartScreen{font-size:.9em;margin:0 auto;padding:36px 0;text-align:center;width:80%}.DocSearch-Screen-Icon{color:var(--docsearch-muted-color);padding-bottom:12px}.DocSearch-NoResults-Prefill-List{display:inline-block;padding-bottom:24px;text-align:left}.DocSearch-NoResults-Prefill-List ul{display:inline-block;padding:8px 0 0}.DocSearch-NoResults-Prefill-List li{list-style-position:inside;list-style-type:"» "}.DocSearch-Prefill{appearance:none;background:none;border:0;border-radius:1em;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;font-size:1em;font-weight:700;padding:0}.DocSearch-Prefill:focus,.DocSearch-Prefill:hover{outline:0;text-decoration:underline}.DocSearch-Footer{align-items:center;background:var(--docsearch-footer-background);border-radius:0 0 8px 8px;box-shadow:var(--docsearch-footer-shadow);display:flex;flex-direction:row-reverse;flex-shrink:0;height:var(--docsearch-footer-height);justify-content:space-between;padding:0 var(--docsearch-spacing);position:relative;-webkit-user-select:none;user-select:none;width:100%;z-index:300}.DocSearch-Commands li,.DocSearch-Commands-Key,.buttons_pzbO,.features_keug{align-items:center;display:flex}.DocSearch-Commands{color:var(--docsearch-muted-color);display:flex;list-style:none;margin:0;padding:0}.DocSearch-Commands li:not(:last-of-type){margin-right:.8em}.DocSearch-Commands-Key{background:var(--docsearch-key-gradient);border:0;border-radius:2px;box-shadow:var(--docsearch-key-shadow);color:var(--docsearch-muted-color);height:18px;justify-content:center;margin-right:.4em;padding:0 0 1px;width:20px}.DocSearch-VisuallyHiddenForAccessibility{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@keyframes a{0%{opacity:0}to{opacity:1}}.DocSearch-Button{margin:0;transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.DocSearch-Container,.skipToContent_fXgn{z-index:calc(var(--ifm-z-index-fixed) + 1)}.skipToContent_fXgn{background-color:var(--ifm-background-surface-color);color:var(--ifm-color-emphasis-900);left:100%;padding:calc(var(--ifm-global-spacing)/2) var(--ifm-global-spacing);position:fixed;top:1rem}.skipToContent_fXgn:focus{box-shadow:var(--ifm-global-shadow-md);left:1rem}.announcementBar_mb4j{align-items:center;background-color:var(--ifm-color-white);border-bottom:1px solid var(--ifm-color-emphasis-100);color:var(--ifm-color-black);display:flex;height:var(--docusaurus-announcement-bar-height)}.announcementBarPlaceholder_vyr4{flex:0 0 10px}.announcementBarClose_gvF7{align-self:stretch;flex:0 0 30px;line-height:0;padding:0}.announcementBarContent_xLdY{flex:1 1 auto;font-size:85%;padding:5px 0;text-align:center}.announcementBarContent_xLdY a{color:inherit;text-decoration:underline}.toggle_vylO{height:2rem;width:2rem}.toggleButton_gllP{align-items:center;border-radius:50%;display:flex;height:100%;justify-content:center;transition:background var(--ifm-transition-fast);width:100%}.toggleButton_gllP:hover{background:var(--ifm-color-emphasis-200)}.toggleButtonDisabled_aARS{cursor:not-allowed}[data-theme=dark] .themedImage--dark_i4oU,[data-theme=light] .themedImage--light_HNdA{display:initial}.iconExternalLink_lCJq{margin-left:.3rem}.iconLanguage_nlXk{margin-right:5px;vertical-align:text-bottom}.navbarHideable_m1mJ{transition:transform var(--ifm-transition-fast) ease}.navbarHidden_jGov{transform:translate3d(0,calc(-100% - 2px),0)}body:not(.navigation-with-keyboard) :not(input):focus{outline:0}.footerLogoLink_BH7S{opacity:.5;transition:opacity var(--ifm-transition-fast) var(--ifm-transition-timing-default)}.footerLogoLink_BH7S:hover,.hash-link:focus,:hover>.hash-link{opacity:1}#__docusaurus{display:flex;flex-direction:column;min-height:100%}.main-wrapper{flex:1 0 auto}.docusaurus-mt-lg{margin-top:3rem}.searchQueryInput_fOvw,.searchVersionInput_uwCD{background:var(--docsearch-searchbox-focus-background);border:2px solid var(--ifm-toc-border-color);border-radius:var(--ifm-global-radius);color:var(--docsearch-text-color);font:var(--ifm-font-size-base) var(--ifm-font-family-base);margin-bottom:.5rem;padding:.8rem;transition:border var(--ifm-transition-fast) ease;width:100%}.searchQueryInput_fOvw:focus,.searchVersionInput_uwCD:focus{border-color:var(--docsearch-primary-color);outline:0}.searchQueryInput_fOvw::placeholder{color:var(--docsearch-muted-color)}.searchResultsColumn_XAOM{font-size:.9rem;font-weight:700}.algoliaLogo_lMQB{max-width:150px}.algoliaLogoPathFill_UGFK{fill:var(--ifm-font-color-base)}.searchResultItem_RfWM{border-bottom:1px solid var(--ifm-toc-border-color);padding:1rem 0}.searchResultItemHeading_cu9x{font-weight:400;margin-bottom:0}.searchResultItemPath_bRHw{--ifm-breadcrumb-separator-size-multiplier:1;color:var(--ifm-color-content-secondary);font-size:.8rem}.searchResultItemSummary_gq1k{font-style:italic;margin:.5rem 0 0}.loadingSpinner_bRrL{animation:1s linear infinite b;border:.4em solid #eee;border-radius:50%;border-top:.4em solid var(--ifm-color-primary);height:3rem;margin:0 auto;width:3rem}@keyframes b{to{transform:rotate(1turn)}}.loader_Ubv2{margin-top:2rem}.search-result-match{background:#ffd78e40;color:var(--docsearch-hit-color);padding:.09em 0}.showcaseHeadingColored_wr9e,.titleLink_sVF8{color:var(--ifm-color-content)}.backToTopButton_sjWU{background-color:var(--ifm-color-emphasis-200);border-radius:50%;bottom:1.3rem;box-shadow:var(--ifm-global-shadow-lw);height:3rem;opacity:0;position:fixed;right:1.3rem;transform:scale(0);transition:all var(--ifm-transition-fast) var(--ifm-transition-timing-default);visibility:hidden;width:3rem;z-index:calc(var(--ifm-z-index-fixed) - 1)}.backToTopButton_sjWU:after{background-color:var(--ifm-color-emphasis-1000);content:" ";display:inline-block;height:100%;-webkit-mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;mask:var(--ifm-menu-link-sublist-icon) 50%/2rem 2rem no-repeat;width:100%}.backToTopButtonShow_xfvO{opacity:1;transform:scale(1);visibility:visible}[data-theme=dark]:root{--docusaurus-collapse-button-bg:#ffffff0d;--docusaurus-collapse-button-bg-hover:#ffffff1a}.docMainContainer_gTbr,.docPage__5DB{display:flex;width:100%}.heroBanner_UJJx{overflow:hidden;padding:4rem 0;position:relative;text-align:center}.buttons_pzbO,.mdxPageWrapper_j9I6{justify-content:center}.features_keug{padding:2rem 0;width:100%}.featureImage_yA8i{height:200px;width:200px}.showcase_SATw{padding:0 20px 80px}.showcaseHeading_iAvm{font-size:30px;line-height:1em;margin-top:20px;padding:10px 0}.showcaseHeadingColored_wr9e{font-weight:600}.showcaseLogos_MhuO{flex-flow:row wrap;padding:20px}.showcaseLogo_uMXs,.showcaseLogos_MhuO{align-items:center;display:flex;justify-content:center}.showcaseLogo_uMXs{background:#0000;border-radius:8px;height:100px;margin:15px;padding:5px;width:100px}[data-theme=dark] .titleLink_sVF8{color:var(--ifm-link-color)}.terminal{-webkit-font-smoothing:auto;word-wrap:normal;background:#0000;background-color:initial!important;border:0;color:#f0f0f0;display:inline-block;font-family:DejaVu Sans Mono,Liberation Mono,monospace,Monaco;font-size:13px;text-align:left;width:100%}span.terminal-cursor{background-color:#f0f0f0;width:10px}.terminal-inner{background:#171923;border-radius:6px;min-height:400px;padding:10px 10px 6px;width:780px}.buttonGroup__atx button,.codeBlockContainer_Ckt0{background:var(--prism-background-color);color:var(--prism-color)}.terminal-content{line-height:16px;margin:20px auto;width:780px}.codeBlockContainer_Ckt0{border-radius:var(--ifm-code-border-radius);box-shadow:var(--ifm-global-shadow-lw);margin-bottom:var(--ifm-leading)}.codeBlockContent_biex{border-radius:inherit;direction:ltr;position:relative}.codeBlockTitle_Ktv7{border-bottom:1px solid var(--ifm-color-emphasis-300);border-top-left-radius:inherit;border-top-right-radius:inherit;font-size:var(--ifm-code-font-size);font-weight:500;padding:.75rem var(--ifm-pre-padding)}.codeBlock_bY9V{--ifm-pre-background:var(--prism-background-color);margin:0;padding:0}.codeBlockTitle_Ktv7+.codeBlockContent_biex .codeBlock_bY9V{border-top-left-radius:0;border-top-right-radius:0}.codeBlockLines_e6Vv{float:left;font:inherit;min-width:100%;padding:var(--ifm-pre-padding)}.codeBlockLinesWithNumbering_o6Pm{display:table;padding:var(--ifm-pre-padding) 0}.buttonGroup__atx{column-gap:.2rem;display:flex;position:absolute;right:calc(var(--ifm-pre-padding)/2);top:calc(var(--ifm-pre-padding)/2)}.buttonGroup__atx button{align-items:center;border:1px solid var(--ifm-color-emphasis-300);border-radius:var(--ifm-global-radius);display:flex;line-height:0;opacity:0;padding:.4rem;transition:opacity .2s ease-in-out}.buttonGroup__atx button:focus-visible,.buttonGroup__atx button:hover{opacity:1!important}.theme-code-block:hover .buttonGroup__atx button{opacity:.4}.theme-code-block-highlighted-line{background-color:var(--docusaurus-highlighted-code-line-bg);display:block;margin:0 calc(var(--ifm-pre-padding)*-1);padding:0 var(--ifm-pre-padding)}:where(:root){--docusaurus-highlighted-code-line-bg:#484d5b}:where([data-theme=dark]){--docusaurus-highlighted-code-line-bg:#646464}.codeLine_lJS_{counter-increment:a;display:table-row}.codeLineNumber_Tfdd{background:var(--ifm-pre-background);display:table-cell;left:0;padding:0 var(--ifm-pre-padding);position:sticky;text-align:right;width:1%}.codeLineNumber_Tfdd:before{content:counter(a);opacity:.4}.codeLineContent_feaV{padding-right:var(--ifm-pre-padding)}.theme-code-block:hover .copyButtonCopied_obH4{opacity:1!important}.copyButtonIcons_eSgA{height:1.125rem;position:relative;width:1.125rem}.copyButtonIcon_y97N,.copyButtonSuccessIcon_LjdS{fill:currentColor;height:inherit;left:0;opacity:inherit;position:absolute;top:0;transition:.15s;width:inherit}.copyButtonSuccessIcon_LjdS{color:#00d600;left:50%;opacity:0;top:50%;transform:translate(-50%,-50%) scale(.33)}.copyButtonCopied_obH4 .copyButtonIcon_y97N{opacity:0;transform:scale(.33)}.copyButtonCopied_obH4 .copyButtonSuccessIcon_LjdS{opacity:1;transform:translate(-50%,-50%) scale(1);transition-delay:75ms}.wordWrapButtonIcon_Bwma{height:1.2rem;width:1.2rem}.tableOfContents_bqdL{max-height:calc(100vh - var(--ifm-navbar-height) - 2rem);overflow-y:auto;position:sticky;top:calc(var(--ifm-navbar-height) + 1rem)}.tocCollapsibleButton_TO0P{align-items:center;display:flex;font-size:inherit;justify-content:space-between;padding:.4rem .8rem;width:100%}.tocCollapsibleButton_TO0P:after{background:var(--ifm-menu-link-sublist-icon) 50% 50%/2rem 2rem no-repeat;content:"";filter:var(--ifm-menu-link-sublist-icon-filter);height:1.25rem;transform:rotate(180deg);transition:transform var(--ifm-transition-fast);width:1.25rem}.tocCollapsibleButtonExpanded_MG3E:after,.tocCollapsibleExpanded_sAul{transform:none}.tocCollapsible_ETCw{background-color:var(--ifm-menu-color-background-active);border-radius:var(--ifm-global-radius);margin:1rem 0}.tocCollapsibleContent_vkbj>ul{border-left:none;border-top:1px solid var(--ifm-color-emphasis-300);font-size:15px;padding:.2rem 0}.tocCollapsibleContent_vkbj ul li{margin:.4rem .8rem}.anchorWithStickyNavbar_LWe7{scroll-margin-top:calc(var(--ifm-navbar-height) + .5rem)}.anchorWithHideOnScrollNavbar_WYt5{scroll-margin-top:.5rem}.hash-link{opacity:0;padding-left:.5rem;transition:opacity var(--ifm-transition-fast);-webkit-user-select:none;user-select:none}.hash-link:before{content:"#"}.breadcrumbsContainer_Z_bl{--ifm-breadcrumb-size-multiplier:0.8;margin-bottom:.8rem}.breadcrumbHomeIcon_OVgt{height:1.1rem;position:relative;top:1px;vertical-align:top;width:1.1rem}.details_lb9f{--docusaurus-details-summary-arrow-size:0.38rem;--docusaurus-details-transition:transform 200ms ease;--docusaurus-details-decoration-color:grey}.details_lb9f>summary{cursor:pointer;list-style:none;padding-left:1rem;position:relative}.details_lb9f>summary::-webkit-details-marker{display:none}.details_lb9f>summary:before{border-color:#0000 #0000 #0000 var(--docusaurus-details-decoration-color);border-style:solid;border-width:var(--docusaurus-details-summary-arrow-size);content:"";left:0;position:absolute;top:.45rem;transform:rotate(0);transform-origin:calc(var(--docusaurus-details-summary-arrow-size)/2) 50%;transition:var(--docusaurus-details-transition)}.collapsibleContent_i85q{border-top:1px solid var(--docusaurus-details-decoration-color);margin-top:1rem;padding-top:1rem}.details_b_Ee{--docusaurus-details-decoration-color:var(--ifm-alert-border-color);--docusaurus-details-transition:transform var(--ifm-transition-fast) ease;border:1px solid var(--ifm-alert-border-color);margin:0 0 var(--ifm-spacing-vertical)}.containsTaskList_mC6p{list-style:none}.img_ev3q{height:auto}@media (min-width:997px){.collapseSidebarButton_PEFL,.expandButton_m80_{background-color:var(--docusaurus-collapse-button-bg);position:sticky}.lastUpdated_vbeJ{text-align:right}:root{--docusaurus-announcement-bar-height:30px}.announcementBarClose_gvF7,.announcementBarPlaceholder_vyr4{flex-basis:50px}.searchBox_ZlJk{padding:var(--ifm-navbar-item-padding-vertical) var(--ifm-navbar-item-padding-horizontal)}.collapseSidebarButton_PEFL{border:1px solid var(--ifm-toc-border-color);border-radius:0;bottom:0;display:block!important;height:40px}.collapseSidebarButtonIcon_kv0_{margin-top:4px;transform:rotate(180deg)}.expandButtonIcon_BlDH,[dir=rtl] .collapseSidebarButtonIcon_kv0_{transform:rotate(0)}.collapseSidebarButton_PEFL:focus,.collapseSidebarButton_PEFL:hover,.expandButton_m80_:focus,.expandButton_m80_:hover{background-color:var(--docusaurus-collapse-button-bg-hover)}.menuHtmlItem_M9Kj{padding:var(--ifm-menu-link-padding-vertical) var(--ifm-menu-link-padding-horizontal)}.menu_SIkG{flex-grow:1;padding:.5rem}@supports (scrollbar-gutter:stable){.menu_SIkG{padding:.5rem 0 .5rem .5rem;scrollbar-gutter:stable}}.menuWithAnnouncementBar_GW3s{margin-bottom:var(--docusaurus-announcement-bar-height)}.sidebar_njMd{display:flex;flex-direction:column;height:100%;max-height:100vh;padding-top:var(--ifm-navbar-height);position:sticky;top:0;transition:opacity 50ms;width:var(--doc-sidebar-width)}.sidebarWithHideableNavbar_wUlq{padding-top:0}.sidebarHidden_VK0M{height:0;opacity:0;overflow:hidden;visibility:hidden}.sidebarLogo_isFc{align-items:center;color:inherit!important;display:flex!important;margin:0 var(--ifm-navbar-padding-horizontal);max-height:var(--ifm-navbar-height);min-height:var(--ifm-navbar-height);text-decoration:none!important}.sidebarLogo_isFc img{height:2rem;margin-right:.5rem}.expandButton_m80_{align-items:center;display:flex;height:100%;justify-content:center;max-height:100vh;top:0;transition:background-color var(--ifm-transition-fast) ease}[dir=rtl] .expandButtonIcon_BlDH{transform:rotate(180deg)}.docSidebarContainer_b6E3{border-right:1px solid var(--ifm-toc-border-color);clip-path:inset(0);display:block;margin-top:calc(var(--ifm-navbar-height)*-1);transition:width var(--ifm-transition-fast) ease;width:var(--doc-sidebar-width);will-change:width}.docSidebarContainerHidden_b3ry{cursor:pointer;width:var(--doc-sidebar-hidden-width)}.docMainContainer_gTbr{flex-grow:1;max-width:calc(100% - var(--doc-sidebar-width))}.docMainContainerEnhanced_Uz_u{max-width:calc(100% - var(--doc-sidebar-hidden-width))}.docItemWrapperEnhanced_czyv{max-width:calc(var(--ifm-container-width) + var(--doc-sidebar-width))!important}.docItemCol_GujU{max-width:75%!important}.tocMobile_aoJ5{display:none}}@media (min-width:1440px){.container{max-width:var(--ifm-container-width-xl)}}@media (max-width:996px){.col{--ifm-col-width:100%;flex-basis:var(--ifm-col-width);margin-left:0}.footer{--ifm-footer-padding-horizontal:0}.colorModeToggle_DEke,.footer__link-separator,.navbar__item,.tableOfContents_bqdL{display:none}.footer__col{margin-bottom:calc(var(--ifm-spacing-vertical)*3)}.footer__link-item{display:block}.hero{padding-left:0;padding-right:0}.navbar>.container,.navbar>.container-fluid{padding:0}.navbar__toggle{display:inherit}.navbar__search-input{width:9rem}.pills--block,.tabs--block{flex-direction:column}.searchBox_ZlJk{position:absolute;right:var(--ifm-navbar-padding-horizontal)}.docItemContainer_F8PC{padding:0 .3rem}}@media only screen and (max-width:996px){.searchQueryColumn_vJqv,.searchResultsColumn_XAOM{max-width:60%!important}.searchLogoColumn_D3Uo,.searchVersionColumn_Afdn{max-width:40%!important}.searchLogoColumn_D3Uo{padding-left:0!important}}@media screen and (max-width:996px){#css-animated-bg-container{background:linear-gradient(#ffe53b,#dac540);padding:1rem 0 60px}.heroBanner_UJJx{padding:2rem}}@media only screen and (max-width:780px){.terminal-content{display:none}}@media (max-width:768px){.DocSearch-Button-Keys,.DocSearch-Button-Placeholder,.DocSearch-Commands,.DocSearch-Hit-Tree{display:none}:root{--docsearch-spacing:10px;--docsearch-footer-height:40px}.DocSearch-Dropdown{height:100%;max-height:calc(var(--docsearch-vh,1vh)*100 - var(--docsearch-searchbox-height) - var(--docsearch-spacing) - var(--docsearch-footer-height))}.DocSearch-Container{height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);position:absolute}.DocSearch-Footer{border-radius:0;bottom:0;position:absolute}.DocSearch-Hit-content-wrapper{display:flex;position:relative;width:80%}.DocSearch-Modal{border-radius:0;box-shadow:none;height:100vh;height:-webkit-fill-available;height:calc(var(--docsearch-vh,1vh)*100);margin:0;max-width:100%;width:100%}.DocSearch-Cancel{appearance:none;background:none;border:0;color:var(--docsearch-highlight-color);cursor:pointer;display:inline-block;flex:none;font:inherit;font-size:1em;font-weight:500;margin-left:var(--docsearch-spacing);outline:0;overflow:hidden;padding:0;-webkit-user-select:none;user-select:none;white-space:nowrap}}@media (max-width:576px){.markdown h1:first-child{--ifm-h1-font-size:2rem}.markdown>h2{--ifm-h2-font-size:1.5rem}.markdown>h3{--ifm-h3-font-size:1.25rem}}@media screen and (max-width:576px){.searchQueryColumn_vJqv{max-width:100%!important}.searchVersionColumn_Afdn{max-width:100%!important;padding-left:var(--ifm-spacing-horizontal)!important}}@media (hover:hover){.backToTopButton_sjWU:hover{background-color:var(--ifm-color-emphasis-300)}}@media (pointer:fine){.thin-scrollbar{scrollbar-width:thin}.thin-scrollbar::-webkit-scrollbar{height:var(--ifm-scrollbar-size);width:var(--ifm-scrollbar-size)}.thin-scrollbar::-webkit-scrollbar-track{background:var(--ifm-scrollbar-track-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb{background:var(--ifm-scrollbar-thumb-background-color);border-radius:10px}.thin-scrollbar::-webkit-scrollbar-thumb:hover{background:var(--ifm-scrollbar-thumb-hover-background-color)}}@media screen and (prefers-reduced-motion:reduce){.DocSearch-Reset{stroke-width:var(--docsearch-icon-stroke-width);animation:none;appearance:none;background:none;border:0;border-radius:50%;color:var(--docsearch-icon-color);cursor:pointer;right:0}.DocSearch-Hit--deleting,.DocSearch-Hit--favoriting{transition:none}.DocSearch-Hit-action-button:focus,.DocSearch-Hit-action-button:hover{background:#0003;transition:none}}@media print{.announcementBar_mb4j,.footer,.menu,.navbar,.pagination-nav,.table-of-contents,.tocMobile_aoJ5{display:none}.tabs{page-break-inside:avoid}.codeBlockLines_e6Vv{white-space:pre-wrap}} \ No newline at end of file diff --git a/assets/js/015e0bf7.778c7c1e.js b/assets/js/015e0bf7.5d199488.js similarity index 98% rename from assets/js/015e0bf7.778c7c1e.js rename to assets/js/015e0bf7.5d199488.js index 6525e0cab..3457ef358 100644 --- a/assets/js/015e0bf7.778c7c1e.js +++ b/assets/js/015e0bf7.5d199488.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2775],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>m});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):r(r({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},g="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,i=e.originalType,o=e.parentName,y=l(e,["components","mdxType","originalType","parentName"]),g=p(n),u=s,m=g["".concat(o,".").concat(u)]||g[u]||c[u]||i;return n?t.createElement(m,r(r({ref:a},y),{},{components:n})):t.createElement(m,r({ref:a},y))}));function m(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var i=n.length,r=new Array(i);r[0]=u;var l={};for(var o in a)hasOwnProperty.call(a,o)&&(l[o]=a[o]);l.originalType=e,l[g]="string"==typeof e?e:s,r[1]=l;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>r,default:()=>c,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const i={id:"heap_analysis_src.StringAnalysis",title:"Class: StringAnalysis",sidebar_label:"StringAnalysis",custom_edit_url:null},r=void 0,l={unversionedId:"api/classes/heap_analysis_src.StringAnalysis",id:"api/classes/heap_analysis_src.StringAnalysis",title:"Class: StringAnalysis",description:"This analysis finds duplicated string instance in JavaScript heap",source:"@site/docs/api/classes/heap_analysis_src.StringAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.StringAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.StringAnalysis",title:"Class: StringAnalysis",sidebar_label:"StringAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ShapeUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"},next:{title:"IBrowserInfo",permalink:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new StringAnalysis()',id:"new-stringanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getTopDuplicatedStringsInCount()',id:"gettopduplicatedstringsincount",level:3}],y={toc:p},g="wrapper";function c(e){let{components:a,...n}=e;return(0,s.yg)(g,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("p",null,"This analysis finds duplicated string instance in JavaScript heap\nand rank them based on the duplicated string size and count."),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"StringAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-stringanalysis"},(0,s.yg)("a",{id:"new stringanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new StringAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"get CLI command name for this memory analysis;\nuse it with ",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")," in CLI"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"p"},"string")," | command name")),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Source"),":"),(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/StringAnalysis.ts#L118"},"heap-analysis/src/plugins/StringAnalysis.ts:118"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"gettopduplicatedstringsincount"},(0,s.yg)("a",{id:"gettopduplicatedstringsincount"}),(0,s.yg)("strong",{parentName:"h3"},"getTopDuplicatedStringsInCount"),"()"),(0,s.yg)("p",null,"get the top duplicated string in terms of duplicated string count"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"p"},"StringRecord"),"[] | an array of the top-duplicated strings' information")),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Source"),":"),(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/StringAnalysis.ts#L68"},"heap-analysis/src/plugins/StringAnalysis.ts:68"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2775],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>m});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):r(r({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},g="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,i=e.originalType,o=e.parentName,y=l(e,["components","mdxType","originalType","parentName"]),g=p(n),u=s,m=g["".concat(o,".").concat(u)]||g[u]||c[u]||i;return n?t.createElement(m,r(r({ref:a},y),{},{components:n})):t.createElement(m,r({ref:a},y))}));function m(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var i=n.length,r=new Array(i);r[0]=u;var l={};for(var o in a)hasOwnProperty.call(a,o)&&(l[o]=a[o]);l.originalType=e,l[g]="string"==typeof e?e:s,r[1]=l;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>r,default:()=>c,frontMatter:()=>i,metadata:()=>l,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const i={id:"heap_analysis_src.StringAnalysis",title:"Class: StringAnalysis",sidebar_label:"StringAnalysis",custom_edit_url:null},r=void 0,l={unversionedId:"api/classes/heap_analysis_src.StringAnalysis",id:"api/classes/heap_analysis_src.StringAnalysis",title:"Class: StringAnalysis",description:"This analysis finds duplicated string instance in JavaScript heap",source:"@site/docs/api/classes/heap_analysis_src.StringAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.StringAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.StringAnalysis",title:"Class: StringAnalysis",sidebar_label:"StringAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ShapeUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"},next:{title:"IBrowserInfo",permalink:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new StringAnalysis()',id:"new-stringanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getTopDuplicatedStringsInCount()',id:"gettopduplicatedstringsincount",level:3}],y={toc:p},g="wrapper";function c(e){let{components:a,...n}=e;return(0,s.yg)(g,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("p",null,"This analysis finds duplicated string instance in JavaScript heap\nand rank them based on the duplicated string size and count."),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"StringAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-stringanalysis"},(0,s.yg)("a",{id:"new stringanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new StringAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"get CLI command name for this memory analysis;\nuse it with ",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")," in CLI"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"p"},"string")," | command name")),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Source"),":"),(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/StringAnalysis.ts#L118"},"heap-analysis/src/plugins/StringAnalysis.ts:118"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"gettopduplicatedstringsincount"},(0,s.yg)("a",{id:"gettopduplicatedstringsincount"}),(0,s.yg)("strong",{parentName:"h3"},"getTopDuplicatedStringsInCount"),"()"),(0,s.yg)("p",null,"get the top duplicated string in terms of duplicated string count"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"p"},"StringRecord"),"[] | an array of the top-duplicated strings' information")),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("strong",{parentName:"p"},"Source"),":"),(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/StringAnalysis.ts#L68"},"heap-analysis/src/plugins/StringAnalysis.ts:68"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/086eefc4.8a0b715b.js b/assets/js/086eefc4.03e603d2.js similarity index 97% rename from assets/js/086eefc4.8a0b715b.js rename to assets/js/086eefc4.03e603d2.js index 1e5523149..21295a495 100644 --- a/assets/js/086eefc4.8a0b715b.js +++ b/assets/js/086eefc4.03e603d2.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[6192],{5680:(e,a,t)=>{t.d(a,{xA:()=>g,yg:()=>d});var n=t(6540);function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function s(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var a=1;a=0||(r[t]=e[t]);return r}(e,a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var i=n.createContext({}),p=function(e){var a=n.useContext(i),t=a;return e&&(t="function"==typeof e?e(a):l(l({},a),e)),t},g=function(e){var a=p(e.components);return n.createElement(i.Provider,{value:a},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},m=n.forwardRef((function(e,a){var t=e.components,r=e.mdxType,s=e.originalType,i=e.parentName,g=o(e,["components","mdxType","originalType","parentName"]),u=p(t),m=r,d=u["".concat(i,".").concat(m)]||u[m]||c[m]||s;return t?n.createElement(d,l(l({ref:a},g),{},{components:t})):n.createElement(d,l({ref:a},g))}));function d(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var s=t.length,l=new Array(s);l[0]=m;var o={};for(var i in a)hasOwnProperty.call(a,i)&&(o[i]=a[i]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var p=2;p{t.r(a),t.d(a,{assets:()=>i,contentTitle:()=>l,default:()=>c,frontMatter:()=>s,metadata:()=>o,toc:()=>p});var n=t(8168),r=(t(6540),t(5680));const s={id:"api_src.SnapshotResultReader",title:"Class: SnapshotResultReader",sidebar_label:"SnapshotResultReader",custom_edit_url:null},l=void 0,o={unversionedId:"api/classes/api_src.SnapshotResultReader",id:"api/classes/api_src.SnapshotResultReader",title:"Class: SnapshotResultReader",description:"A utility entity to read all MemLab files generated from",source:"@site/docs/api/classes/api_src.SnapshotResultReader.md",sourceDirName:"api/classes",slug:"/api/classes/api_src.SnapshotResultReader",permalink:"/memlab/docs/api/classes/api_src.SnapshotResultReader",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"api_src.SnapshotResultReader",title:"Class: SnapshotResultReader",sidebar_label:"SnapshotResultReader",custom_edit_url:null},sidebar:"sidebar",previous:{title:"BrowserInteractionResultReader",permalink:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},next:{title:"BaseAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"}},i={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Methods",id:"methods",level:2},{value:'getConsoleBackupFile()',id:"getconsolebackupfile",level:3},{value:'getInteractionSteps()',id:"getinteractionsteps",level:3},{value:'getRootDirectory()',id:"getrootdirectory",level:3},{value:'getSnapshotFiles()',id:"getsnapshotfiles",level:3},{value:'Static fromSnapshots(baselineSnapshot, targetSnapshot, finalSnapshot)',id:"static-fromsnapshotsbaselinesnapshot-targetsnapshot-finalsnapshot",level:3}],g={toc:p},u="wrapper";function c(e){let{components:a,...t}=e;return(0,r.yg)(u,(0,n.A)({},g,t,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"A utility entity to read all MemLab files generated from\nbaseline, target and final heap snapshots."),(0,r.yg)("p",null,"The most useful feature of this class is when you have\nthree separate snapshots (baseline, target, and final)\nthat are not taken from MemLab, but you still would\nlike to use the ",(0,r.yg)("inlineCode",{parentName:"p"},"findLeaks")," to detect memory leaks:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader, findLeaks} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst leaks = await findLeaks(reader);\n")),(0,r.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("inlineCode",{parentName:"p"},"default")),(0,r.yg)("p",{parentName:"li"},"\u21b3 ",(0,r.yg)("strong",{parentName:"p"},(0,r.yg)("inlineCode",{parentName:"strong"},"SnapshotResultReader"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"getconsolebackupfile"},(0,r.yg)("a",{id:"getconsolebackupfile"}),(0,r.yg)("strong",{parentName:"h3"},"getConsoleBackupFile"),"()"),(0,r.yg)("p",null,"This method gets the backup file of the console output."),(0,r.yg)("p",null,"The memlab CLI commands (e.g., ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab find-leaks"),") outputs a\nnon-structured string representation for easy reading, while the\nAPIs (e.g., ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#findleaks"},"findLeaks")),") return structured leaks\nrepresentation that is handy for post-processing. If you need to\nobtain all the string output from the CLI in the current working directory,\nyou can read them from the CLI output backup file returned by this method."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the backup file"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots, findLeaks} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n const leaks = await findLeaks(result);\n\n // get the console output backup file\n const consoleBackupFile = result.getConsoleBackupFile();\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BaseResultReader.ts#L102"},"api/src/result-reader/BaseResultReader.ts:102"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getinteractionsteps"},(0,r.yg)("a",{id:"getinteractionsteps"}),(0,r.yg)("strong",{parentName:"h3"},"getInteractionSteps"),"()"),(0,r.yg)("p",null,"browser interaction step sequence"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"E2EStepInfo"),"[] | an array of browser interaction step information")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst paths = reader.getInteractionSteps();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/SnapshotResultReader.ts#L159"},"api/src/result-reader/SnapshotResultReader.ts:159"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getrootdirectory"},(0,r.yg)("a",{id:"getrootdirectory"}),(0,r.yg)("strong",{parentName:"h3"},"getRootDirectory"),"()"),(0,r.yg)("p",null,"get the directory where the data and generated files of\nthe memlab run were stored"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | absolute path of the directory"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get the directory that stores all the files\n // generated from the takeSnapshots call\n const dataDir = result.getRootDirectory();\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BaseResultReader.ts#L72"},"api/src/result-reader/BaseResultReader.ts:72"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getsnapshotfiles"},(0,r.yg)("a",{id:"getsnapshotfiles"}),(0,r.yg)("strong",{parentName:"h3"},"getSnapshotFiles"),"()"),(0,r.yg)("p",null,"get all snapshot files related to this SnapshotResultReader"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"string"),"[] | an array of snapshot file's absolute path")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst paths = reader.getSnapshotFiles();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/SnapshotResultReader.ts#L132"},"api/src/result-reader/SnapshotResultReader.ts:132"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"static-fromsnapshotsbaselinesnapshot-targetsnapshot-finalsnapshot"},(0,r.yg)("a",{id:"fromsnapshots"}),(0,r.yg)("inlineCode",{parentName:"h3"},"Static")," ",(0,r.yg)("strong",{parentName:"h3"},"fromSnapshots"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"baselineSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"targetSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"finalSnapshot"),")"),(0,r.yg)("p",null,"Build a result reader from baseline, target, and final heap snapshot files.\nThe three snapshot files do not have to be in the same directory."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"baselineSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | file path of the baseline heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"targetSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | file path of the target heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"finalSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | file path of the final heap snapshot"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.SnapshotResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"SnapshotResultReader"))," | the ResultReader instance")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader, findLeaks} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst leaks = await findLeaks(reader);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/SnapshotResultReader.ts#L99"},"api/src/result-reader/SnapshotResultReader.ts:99"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[6192],{5680:(e,a,t)=>{t.d(a,{xA:()=>g,yg:()=>d});var n=t(6540);function r(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function s(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);a&&(n=n.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var a=1;a=0||(r[t]=e[t]);return r}(e,a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var i=n.createContext({}),p=function(e){var a=n.useContext(i),t=a;return e&&(t="function"==typeof e?e(a):l(l({},a),e)),t},g=function(e){var a=p(e.components);return n.createElement(i.Provider,{value:a},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return n.createElement(n.Fragment,{},a)}},m=n.forwardRef((function(e,a){var t=e.components,r=e.mdxType,s=e.originalType,i=e.parentName,g=o(e,["components","mdxType","originalType","parentName"]),u=p(t),m=r,d=u["".concat(i,".").concat(m)]||u[m]||c[m]||s;return t?n.createElement(d,l(l({ref:a},g),{},{components:t})):n.createElement(d,l({ref:a},g))}));function d(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var s=t.length,l=new Array(s);l[0]=m;var o={};for(var i in a)hasOwnProperty.call(a,i)&&(o[i]=a[i]);o.originalType=e,o[u]="string"==typeof e?e:r,l[1]=o;for(var p=2;p{t.r(a),t.d(a,{assets:()=>i,contentTitle:()=>l,default:()=>c,frontMatter:()=>s,metadata:()=>o,toc:()=>p});var n=t(8168),r=(t(6540),t(5680));const s={id:"api_src.SnapshotResultReader",title:"Class: SnapshotResultReader",sidebar_label:"SnapshotResultReader",custom_edit_url:null},l=void 0,o={unversionedId:"api/classes/api_src.SnapshotResultReader",id:"api/classes/api_src.SnapshotResultReader",title:"Class: SnapshotResultReader",description:"A utility entity to read all MemLab files generated from",source:"@site/docs/api/classes/api_src.SnapshotResultReader.md",sourceDirName:"api/classes",slug:"/api/classes/api_src.SnapshotResultReader",permalink:"/memlab/docs/api/classes/api_src.SnapshotResultReader",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"api_src.SnapshotResultReader",title:"Class: SnapshotResultReader",sidebar_label:"SnapshotResultReader",custom_edit_url:null},sidebar:"sidebar",previous:{title:"BrowserInteractionResultReader",permalink:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},next:{title:"BaseAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"}},i={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Methods",id:"methods",level:2},{value:'getConsoleBackupFile()',id:"getconsolebackupfile",level:3},{value:'getInteractionSteps()',id:"getinteractionsteps",level:3},{value:'getRootDirectory()',id:"getrootdirectory",level:3},{value:'getSnapshotFiles()',id:"getsnapshotfiles",level:3},{value:'Static fromSnapshots(baselineSnapshot, targetSnapshot, finalSnapshot)',id:"static-fromsnapshotsbaselinesnapshot-targetsnapshot-finalsnapshot",level:3}],g={toc:p},u="wrapper";function c(e){let{components:a,...t}=e;return(0,r.yg)(u,(0,n.A)({},g,t,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"A utility entity to read all MemLab files generated from\nbaseline, target and final heap snapshots."),(0,r.yg)("p",null,"The most useful feature of this class is when you have\nthree separate snapshots (baseline, target, and final)\nthat are not taken from MemLab, but you still would\nlike to use the ",(0,r.yg)("inlineCode",{parentName:"p"},"findLeaks")," to detect memory leaks:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader, findLeaks} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst leaks = await findLeaks(reader);\n")),(0,r.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("inlineCode",{parentName:"p"},"default")),(0,r.yg)("p",{parentName:"li"},"\u21b3 ",(0,r.yg)("strong",{parentName:"p"},(0,r.yg)("inlineCode",{parentName:"strong"},"SnapshotResultReader"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"getconsolebackupfile"},(0,r.yg)("a",{id:"getconsolebackupfile"}),(0,r.yg)("strong",{parentName:"h3"},"getConsoleBackupFile"),"()"),(0,r.yg)("p",null,"This method gets the backup file of the console output."),(0,r.yg)("p",null,"The memlab CLI commands (e.g., ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab find-leaks"),") outputs a\nnon-structured string representation for easy reading, while the\nAPIs (e.g., ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#findleaks"},"findLeaks")),") return structured leaks\nrepresentation that is handy for post-processing. If you need to\nobtain all the string output from the CLI in the current working directory,\nyou can read them from the CLI output backup file returned by this method."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the backup file"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots, findLeaks} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n const leaks = await findLeaks(result);\n\n // get the console output backup file\n const consoleBackupFile = result.getConsoleBackupFile();\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BaseResultReader.ts#L102"},"api/src/result-reader/BaseResultReader.ts:102"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getinteractionsteps"},(0,r.yg)("a",{id:"getinteractionsteps"}),(0,r.yg)("strong",{parentName:"h3"},"getInteractionSteps"),"()"),(0,r.yg)("p",null,"browser interaction step sequence"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"E2EStepInfo"),"[] | an array of browser interaction step information")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst paths = reader.getInteractionSteps();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/SnapshotResultReader.ts#L159"},"api/src/result-reader/SnapshotResultReader.ts:159"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getrootdirectory"},(0,r.yg)("a",{id:"getrootdirectory"}),(0,r.yg)("strong",{parentName:"h3"},"getRootDirectory"),"()"),(0,r.yg)("p",null,"get the directory where the data and generated files of\nthe memlab run were stored"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | absolute path of the directory"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get the directory that stores all the files\n // generated from the takeSnapshots call\n const dataDir = result.getRootDirectory();\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BaseResultReader.ts#L72"},"api/src/result-reader/BaseResultReader.ts:72"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getsnapshotfiles"},(0,r.yg)("a",{id:"getsnapshotfiles"}),(0,r.yg)("strong",{parentName:"h3"},"getSnapshotFiles"),"()"),(0,r.yg)("p",null,"get all snapshot files related to this SnapshotResultReader"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"string"),"[] | an array of snapshot file's absolute path")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst paths = reader.getSnapshotFiles();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/SnapshotResultReader.ts#L132"},"api/src/result-reader/SnapshotResultReader.ts:132"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"static-fromsnapshotsbaselinesnapshot-targetsnapshot-finalsnapshot"},(0,r.yg)("a",{id:"fromsnapshots"}),(0,r.yg)("inlineCode",{parentName:"h3"},"Static")," ",(0,r.yg)("strong",{parentName:"h3"},"fromSnapshots"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"baselineSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"targetSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"finalSnapshot"),")"),(0,r.yg)("p",null,"Build a result reader from baseline, target, and final heap snapshot files.\nThe three snapshot files do not have to be in the same directory."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"baselineSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | file path of the baseline heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"targetSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | file path of the target heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"finalSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | file path of the final heap snapshot"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.SnapshotResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"SnapshotResultReader"))," | the ResultReader instance")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {SnapshotResultReader, findLeaks} = require('@memlab/api');\n\n// baseline, target, and final are file paths of heap snapshot files\nconst reader = SnapshotResultReader.fromSnapshots(baseline, target, final);\nconst leaks = await findLeaks(reader);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/SnapshotResultReader.ts#L99"},"api/src/result-reader/SnapshotResultReader.ts:99"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/0d63082f.1f211aa5.js b/assets/js/0d63082f.d417ec8e.js similarity index 97% rename from assets/js/0d63082f.1f211aa5.js rename to assets/js/0d63082f.d417ec8e.js index 137604ebe..9b7f9b96e 100644 --- a/assets/js/0d63082f.1f211aa5.js +++ b/assets/js/0d63082f.d417ec8e.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[5214],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>u});var s=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var o=s.createContext({}),p=function(e){var a=s.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return s.createElement(o.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return s.createElement(s.Fragment,{},a)}},c=s.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),g=p(n),c=t,u=g["".concat(o,".").concat(c)]||g[c]||m[c]||l;return n?s.createElement(u,i(i({ref:a},y),{},{components:n})):s.createElement(u,i({ref:a},y))}));function u(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=c;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[g]="string"==typeof e?e:t,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var s=n(8168),t=(n(6540),n(5680));const l={id:"heap_analysis_src.BaseAnalysis",title:"Class: BaseAnalysis",sidebar_label:"BaseAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.BaseAnalysis",id:"api/classes/heap_analysis_src.BaseAnalysis",title:"Class: BaseAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.BaseAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.BaseAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.BaseAnalysis",title:"Class: BaseAnalysis",sidebar_label:"BaseAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"SnapshotResultReader",permalink:"/memlab/docs/api/classes/api_src.SnapshotResultReader"},next:{title:"CollectionsHoldingStaleAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new BaseAnalysis()',id:"new-baseanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'analyzeSnapshotsInDirectory(directory, options?)',id:"analyzesnapshotsindirectorydirectory-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getDescription()',id:"getdescription",level:3},{value:'getOptions()',id:"getoptions",level:3},{value:'process(options)',id:"processoptions",level:3}],y={toc:p},g="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(g,(0,s.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("inlineCode",{parentName:"p"},"Analysis")),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"BaseAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"DetachedDOMElementAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"GlobalVariableAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"CollectionsHoldingStaleAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectShallowAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectSizeAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ShapeUnboundGrowthAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectFanoutAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectShapeAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectUnboundGrowthAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"StringAnalysis"))))),(0,t.yg)("h2",{id:"constructors"},"Constructors"),(0,t.yg)("h3",{id:"new-baseanalysis"},(0,t.yg)("a",{id:"new baseanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"new BaseAnalysis"),"()"),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,t.yg)("a",{id:"analyzesnapshotfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,t.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,t.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Example"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,t.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"analyzesnapshotsindirectorydirectory-options"},(0,t.yg)("a",{id:"analyzesnapshotsindirectory"}),(0,t.yg)("strong",{parentName:"h3"},"analyzeSnapshotsInDirectory"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"directory"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,t.yg)("p",null,"Run heap analysis for a series of heap snapshot files"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"directory"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory holding a series of ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," files, all snapshot files will be loaded and analyzed in the alphanumerically ascending order of those snapshot file names."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,t.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Example"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory);\n// query analysis-specific and structured results\nconst shapes = analysis.getShapesWithUnboundGrowth();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L148"},"heap-analysis/src/BaseAnalysis.ts:148"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getcommandname"},(0,t.yg)("a",{id:"getcommandname"}),(0,t.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,t.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,t.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L189"},"heap-analysis/src/BaseAnalysis.ts:189"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getdescription"},(0,t.yg)("a",{id:"getdescription"}),(0,t.yg)("strong",{parentName:"h3"},"getDescription"),"()"),(0,t.yg)("p",null,"Get the textual description of the heap analysis.\nThe description of this analysis will be printed by:\n",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze list")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"string")," | the description")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L201"},"heap-analysis/src/BaseAnalysis.ts:201"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getoptions"},(0,t.yg)("a",{id:"getoptions"}),(0,t.yg)("strong",{parentName:"h3"},"getOptions"),"()"),(0,t.yg)("p",null,"override this method if you would like CLI to print the option info"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"default"),"[] | an array of command line options")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L228"},"heap-analysis/src/BaseAnalysis.ts:228"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"processoptions"},(0,t.yg)("a",{id:"process"}),(0,t.yg)("strong",{parentName:"h3"},"process"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Callback for ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze "),".\nDo the memory analysis and print results in this callback\nThe analysis should support:\n1) printing results on screen\n2) returning results via the return value"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | This is the auto-generated arguments passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"process")," method that your self-defined heap analysis should implement. You are not supposed to construct instances of this class."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"any"),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L216"},"heap-analysis/src/BaseAnalysis.ts:216"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[5214],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>u});var s=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var o=s.createContext({}),p=function(e){var a=s.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return s.createElement(o.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return s.createElement(s.Fragment,{},a)}},c=s.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),g=p(n),c=t,u=g["".concat(o,".").concat(c)]||g[c]||m[c]||l;return n?s.createElement(u,i(i({ref:a},y),{},{components:n})):s.createElement(u,i({ref:a},y))}));function u(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=c;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[g]="string"==typeof e?e:t,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var s=n(8168),t=(n(6540),n(5680));const l={id:"heap_analysis_src.BaseAnalysis",title:"Class: BaseAnalysis",sidebar_label:"BaseAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.BaseAnalysis",id:"api/classes/heap_analysis_src.BaseAnalysis",title:"Class: BaseAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.BaseAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.BaseAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.BaseAnalysis",title:"Class: BaseAnalysis",sidebar_label:"BaseAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"SnapshotResultReader",permalink:"/memlab/docs/api/classes/api_src.SnapshotResultReader"},next:{title:"CollectionsHoldingStaleAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new BaseAnalysis()',id:"new-baseanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'analyzeSnapshotsInDirectory(directory, options?)',id:"analyzesnapshotsindirectorydirectory-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getDescription()',id:"getdescription",level:3},{value:'getOptions()',id:"getoptions",level:3},{value:'process(options)',id:"processoptions",level:3}],y={toc:p},g="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(g,(0,s.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("inlineCode",{parentName:"p"},"Analysis")),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"BaseAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"DetachedDOMElementAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"GlobalVariableAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"CollectionsHoldingStaleAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectShallowAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectSizeAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ShapeUnboundGrowthAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectFanoutAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectShapeAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"ObjectUnboundGrowthAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"StringAnalysis"))))),(0,t.yg)("h2",{id:"constructors"},"Constructors"),(0,t.yg)("h3",{id:"new-baseanalysis"},(0,t.yg)("a",{id:"new baseanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"new BaseAnalysis"),"()"),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,t.yg)("a",{id:"analyzesnapshotfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,t.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,t.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Example"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,t.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"analyzesnapshotsindirectorydirectory-options"},(0,t.yg)("a",{id:"analyzesnapshotsindirectory"}),(0,t.yg)("strong",{parentName:"h3"},"analyzeSnapshotsInDirectory"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"directory"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,t.yg)("p",null,"Run heap analysis for a series of heap snapshot files"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"directory"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory holding a series of ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," files, all snapshot files will be loaded and analyzed in the alphanumerically ascending order of those snapshot file names."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,t.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Example"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory);\n// query analysis-specific and structured results\nconst shapes = analysis.getShapesWithUnboundGrowth();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L148"},"heap-analysis/src/BaseAnalysis.ts:148"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getcommandname"},(0,t.yg)("a",{id:"getcommandname"}),(0,t.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,t.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,t.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L189"},"heap-analysis/src/BaseAnalysis.ts:189"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getdescription"},(0,t.yg)("a",{id:"getdescription"}),(0,t.yg)("strong",{parentName:"h3"},"getDescription"),"()"),(0,t.yg)("p",null,"Get the textual description of the heap analysis.\nThe description of this analysis will be printed by:\n",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze list")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"string")," | the description")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L201"},"heap-analysis/src/BaseAnalysis.ts:201"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getoptions"},(0,t.yg)("a",{id:"getoptions"}),(0,t.yg)("strong",{parentName:"h3"},"getOptions"),"()"),(0,t.yg)("p",null,"override this method if you would like CLI to print the option info"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"default"),"[] | an array of command line options")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L228"},"heap-analysis/src/BaseAnalysis.ts:228"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"processoptions"},(0,t.yg)("a",{id:"process"}),(0,t.yg)("strong",{parentName:"h3"},"process"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Callback for ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze "),".\nDo the memory analysis and print results in this callback\nThe analysis should support:\n1) printing results on screen\n2) returning results via the return value"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | This is the auto-generated arguments passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"process")," method that your self-defined heap analysis should implement. You are not supposed to construct instances of this class."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"any"),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L216"},"heap-analysis/src/BaseAnalysis.ts:216"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/0ee6ea57.a75b63cc.js b/assets/js/0ee6ea57.47f61e7a.js similarity index 95% rename from assets/js/0ee6ea57.a75b63cc.js rename to assets/js/0ee6ea57.47f61e7a.js index 436ceefb7..8f8dcd2bc 100644 --- a/assets/js/0ee6ea57.a75b63cc.js +++ b/assets/js/0ee6ea57.47f61e7a.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[4573],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var p=r.createContext({}),g=function(e){var a=r.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):o(o({},a),e)),n},s=function(e){var a=g(e.components);return r.createElement(p.Provider,{value:a},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},m=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),c=g(n),m=t,y=c["".concat(p,".").concat(m)]||c[m]||d[m]||i;return n?r.createElement(y,o(o({ref:a},s),{},{components:n})):r.createElement(y,o({ref:a},s))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var i=n.length,o=new Array(i);o[0]=m;var l={};for(var p in a)hasOwnProperty.call(a,p)&&(l[p]=a[p]);l.originalType=e,l[c]="string"==typeof e?e:t,o[1]=l;for(var g=2;g{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>o,default:()=>d,frontMatter:()=>i,metadata:()=>l,toc:()=>g});var r=n(8168),t=(n(6540),n(5680));const i={id:"core_src.IHeapNode",title:"Interface: IHeapNode",sidebar_label:"IHeapNode",custom_edit_url:null},o=void 0,l={unversionedId:"api/interfaces/core_src.IHeapNode",id:"api/interfaces/core_src.IHeapNode",title:"Interface: IHeapNode",description:"An IHeapNode instance represents a JS heap object in a heap snapshot.",source:"@site/docs/api/interfaces/core_src.IHeapNode.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNode",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapNode",title:"Interface: IHeapNode",sidebar_label:"IHeapNode",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapLocation",permalink:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},next:{title:"IHeapNodes",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNodes"}},p={},g=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Properties",id:"properties",level:2},{value:' dominatorNode: Nullable<IHeapNode>',id:"-dominatornode-nullableiheapnode",level:3},{value:' edge_count: number',id:"-edge_count-number",level:3},{value:' hasPathEdge: boolean',id:"-haspathedge-boolean",level:3},{value:' id: number',id:"-id-number",level:3},{value:' isString: boolean',id:"-isstring-boolean",level:3},{value:' is_detached: boolean',id:"-is_detached-boolean",level:3},{value:' location: Nullable<IHeapLocation>',id:"-location-nullableiheaplocation",level:3},{value:' name: string',id:"-name-string",level:3},{value:' nodeIndex: number',id:"-nodeindex-number",level:3},{value:' numOfReferrers: number',id:"-numofreferrers-number",level:3},{value:' pathEdge: null | IHeapEdge',id:"-pathedge-null--iheapedge",level:3},{value:' references: IHeapEdge[]',id:"-references-iheapedge",level:3},{value:' referrers: IHeapEdge[]',id:"-referrers-iheapedge",level:3},{value:' retainedSize: number',id:"-retainedsize-number",level:3},{value:' self_size: number',id:"-self_size-number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:' type: string',id:"-type-string",level:3},{value:"Methods",id:"methods",level:2},{value:'findAnyReference(predicate)',id:"findanyreferencepredicate",level:3},{value:'findAnyReferrer(predicate)',id:"findanyreferrerpredicate",level:3},{value:'findAnyReferrerNode(predicate)',id:"findanyreferrernodepredicate",level:3},{value:'findReferrerNodes(predicate)',id:"findreferrernodespredicate",level:3},{value:'findReferrers(predicate)',id:"findreferrerspredicate",level:3},{value:'forEachReference(callback)',id:"foreachreferencecallback",level:3},{value:'forEachReferrer(callback)',id:"foreachreferrercallback",level:3},{value:'getAnyReferrer(edgeName, edgeType?)',id:"getanyreferreredgename-edgetype",level:3},{value:'getAnyReferrerNode(edgeName, edgeType?)',id:"getanyreferrernodeedgename-edgetype",level:3},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'getReference(edgeName, edgeType?)',id:"getreferenceedgename-edgetype",level:3},{value:'getReferenceNode(edgeName, edgeType?)',id:"getreferencenodeedgename-edgetype",level:3},{value:'getReferrerNodes(edgeName, edgeType?)',id:"getreferrernodesedgename-edgetype",level:3},{value:'getReferrers(edgeName, edgeType?)',id:"getreferrersedgename-edgetype",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3},{value:'toStringNode()',id:"tostringnode",level:3}],s={toc:g},c="wrapper";function d(e){let{components:a,...n}=e;return(0,t.yg)(c,(0,r.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"An ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapNode")," instance represents a JS heap object in a heap snapshot.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapNode")," instance"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each node (heap object)\n heap.nodes.forEach((node: IHeapNode, i: number) => {\n // use the heap node APIs here\n const id = node.id;\n const type = node.type;\n // ...\n });\n})();\n")),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("inlineCode",{parentName:"p"},"IHeapNodeBasic")),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"IHeapNode"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapStringNode"))))),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-dominatornode-nullableiheapnode"},(0,t.yg)("a",{id:"dominatornode",name:"dominatornode"})," ",(0,t.yg)("strong",{parentName:"h3"},"dominatorNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"),(0,t.yg)("p",null,"get the dominator node of this node. If the dominator node gets released\nthere will be no path from GC to this node, and therefore this node can\nalso be released.\nFor more information on what a dominator node is, please check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1904"},"core/src/lib/Types.ts:1904"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-edge_count-number"},(0,t.yg)("a",{id:"edge\\_count",name:"edge\\_count"})," ",(0,t.yg)("strong",{parentName:"h3"},"edge","_","count"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of outgoing JS references (including engine-internal,\nnative, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1858"},"core/src/lib/Types.ts:1858"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-haspathedge-boolean"},(0,t.yg)("a",{id:"haspathedge",name:"haspathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"hasPathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"returns true if the heap node has been set an incoming edge\nwhich leads to the parent node on the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1880"},"core/src/lib/Types.ts:1880"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-id-number"},(0,t.yg)("a",{id:"id",name:"id"})," ",(0,t.yg)("strong",{parentName:"h3"},"id"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"unique id of the heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1785"},"core/src/lib/Types.ts:1785"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-isstring-boolean"},(0,t.yg)("a",{id:"isstring",name:"isstring"})," ",(0,t.yg)("strong",{parentName:"h3"},"isString"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"check if this a string node (normal string node, concatenated string node\nor sliced string node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1916"},"core/src/lib/Types.ts:1916"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-is_detached-boolean"},(0,t.yg)("a",{id:"is\\_detached",name:"is\\_detached"})," ",(0,t.yg)("strong",{parentName:"h3"},"is","_","detached"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a DOM element and the DOM element is detached\nfrom the DOM tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a React Fiber node and the Fiber node is unmounted\nfrom the React Fiber tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";\notherwise it will be ",(0,t.yg)("inlineCode",{parentName:"p"},"false"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1840"},"core/src/lib/Types.ts:1840"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-location-nullableiheaplocation"},(0,t.yg)("a",{id:"location",name:"location"})," ",(0,t.yg)("strong",{parentName:"h3"},"location"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapLocation")),">"),(0,t.yg)("p",null,"source location information of this heap object (if it is recorded by\nthe heap snapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1909"},"core/src/lib/Types.ts:1909"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-name-string"},(0,t.yg)("a",{id:"name",name:"name"})," ",(0,t.yg)("strong",{parentName:"h3"},"name"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"this is the ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," field associated with the heap object,\nfor JS object instances (type ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),"), ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the constructor's name\nof the object instance. for ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the string value."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1781"},"core/src/lib/Types.ts:1781"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-nodeindex-number"},(0,t.yg)("a",{id:"nodeindex",name:"nodeindex"})," ",(0,t.yg)("strong",{parentName:"h3"},"nodeIndex"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"index of this heap object inside the ",(0,t.yg)("inlineCode",{parentName:"p"},"node.snapshot.nodes")," pseudo array"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1889"},"core/src/lib/Types.ts:1889"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-numofreferrers-number"},(0,t.yg)("a",{id:"numofreferrers",name:"numofreferrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"numOfReferrers"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"Get the number of all incoming references pointing to this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1875"},"core/src/lib/Types.ts:1875"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-pathedge-null--iheapedge"},(0,t.yg)("a",{id:"pathedge",name:"pathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"pathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"null")," ","|"," ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))),(0,t.yg)("p",null,"The incoming edge which leads to the parent node\non the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1885"},"core/src/lib/Types.ts:1885"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-references-iheapedge"},(0,t.yg)("a",{id:"references",name:"references"})," ",(0,t.yg)("strong",{parentName:"h3"},"references"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all outgoing JS references from this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1865"},"core/src/lib/Types.ts:1865"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-referrers-iheapedge"},(0,t.yg)("a",{id:"referrers",name:"referrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"referrers"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all incoming JS references pointing to this heap\nobject (including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1870"},"core/src/lib/Types.ts:1870"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-retainedsize-number"},(0,t.yg)("a",{id:"retainedsize",name:"retainedsize"})," ",(0,t.yg)("strong",{parentName:"h3"},"retainedSize"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"retained size")," of the heap object (i.e., the total size of memory that\ncould be released if this object is released). For difference between\n",(0,t.yg)("strong",{parentName:"p"},"retained size")," and ",(0,t.yg)("strong",{parentName:"p"},"shallow size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1896"},"core/src/lib/Types.ts:1896"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-self_size-number"},(0,t.yg)("a",{id:"self\\_size",name:"self\\_size"})," ",(0,t.yg)("strong",{parentName:"h3"},"self","_","size"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"shallow size")," of the heap object (i.e., the size of memory that is held\nby the object itself.). For difference between ",(0,t.yg)("strong",{parentName:"p"},"shallow size")," and\n",(0,t.yg)("strong",{parentName:"p"},"retained size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1853"},"core/src/lib/Types.ts:1853"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,t.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,t.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,t.yg)("p",null,"get the ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1832"},"core/src/lib/Types.ts:1832"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-type-string"},(0,t.yg)("a",{id:"type",name:"type"})," ",(0,t.yg)("strong",{parentName:"h3"},"type"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"the type of the heap node object. All possible types:\nThis is engine-specific, for example all types in V8:\n",(0,t.yg)("inlineCode",{parentName:"p"},"hidden"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"array"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"code"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"closure"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"regexp"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"number"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"native"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"synthetic"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"concatenated string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"sliced string"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"symbol"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"bigint")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1775"},"core/src/lib/Types.ts:1775"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"findanyreferencepredicate"},(0,t.yg)("a",{id:"findanyreference"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\nin the hosting node (or outgoing edges from the node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first outgoing edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const reference = node.findAnyReference((edge: IHeapEdge) => {\n // find the outgoing reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1997"},"core/src/lib/Types.ts:1997"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrerpredicate"},(0,t.yg)("a",{id:"findanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node) until the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first incoming edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrer((edge: IHeapEdge) => {\n // find the incoming reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2014"},"core/src/lib/Types.ts:2014"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrernodepredicate"},(0,t.yg)("a",{id:"findanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each incoming JavaScript heap object"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the first referring node for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such node is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrerNode((node: IHeapNode) => {\n // find the referring node with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2032"},"core/src/lib/Types.ts:2032"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrernodespredicate"},(0,t.yg)("a",{id:"findreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each referrer nodes"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing all the referrer nodes for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nnode is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrerNodes = node.findReferrerNodes((node: IHeapNode) => {\n // find all the referring nodes with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2067"},"core/src/lib/Types.ts:2067"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrerspredicate"},(0,t.yg)("a",{id:"findreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nedge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrers = node.findReferrers((edge: IHeapEdge) => {\n // find all the incoming references with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2049"},"core/src/lib/Types.ts:2049"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferencecallback"},(0,t.yg)("a",{id:"foreachreference"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference in the\nhosting node (or outgoing edges from the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReference((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.references list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1962"},"core/src/lib/Types.ts:1962"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferrercallback"},(0,t.yg)("a",{id:"foreachreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference pointing\nto the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReferrer((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.referrers list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1980"},"core/src/lib/Types.ts:1980"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferreredgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the incoming edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS reference named \"ref\" pointing to node\nconst reference = node.getAnyReferrer('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2122"},"core/src/lib/Types.ts:2122"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferrernodeedgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds one of the incoming JS\nreferences pointing to the hosting node, and returns the JS heap object\ncontaining the incoming reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node containing the incoming JS reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst n1 = node.getAnyReferrerNode('ref', 'property');\n// this is equivalent to\nconst n2 = node.getAnyReferrer('ref', 'property')?.fromNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2145"},"core/src/lib/Types.ts:2145"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getjsonifyableobject"},(0,t.yg)("a",{id:"getjsonifyableobject"}),(0,t.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,t.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1931"},"core/src/lib/Types.ts:1931"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferenceedgename-edgetype"},(0,t.yg)("a",{id:"getreference"}),(0,t.yg)("strong",{parentName:"h3"},"getReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an outgoing JS\nreference from the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the outgoing edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the internal reference to node's hidden class\nconst reference = node.getReference('map', 'hidden');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2082"},"core/src/lib/Types.ts:2082"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferencenodeedgename-edgetype"},(0,t.yg)("a",{id:"getreferencenode"}),(0,t.yg)("strong",{parentName:"h3"},"getReferenceNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds the outgoing JS\nreference from the hosting node, and returns the JS heap object pointed to\nby the outgoing JS reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node pointed to by the outgoing reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the node's hidden class\nconst hiddenClassNode = node.getReferenceNode('map', 'hidden');\n// this is equivalent to\nconst hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2104"},"core/src/lib/Types.ts:2104"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrernodesedgename-edgetype"},(0,t.yg)("a",{id:"getreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all of the incoming JS\nreferences pointing to the hosting node, and returns an array containing\nthe hosting node for each of the incoming JS references."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing the hosting nodes, with each node corresponds\nto each incoming JS reference that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst nodes1 = node.getReferrerNodes('ref', 'property');\n// this is equivalent to\nconst nodes2 = node.getReferrers('ref', 'property')\n .map(edge => edge.fromNode);\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2185"},"core/src/lib/Types.ts:2185"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrersedgename-edgetype"},(0,t.yg)("a",{id:"getreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all the incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges that\nmeet the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of of the JS reference named \"ref\" pointing to node\nconst referrers = node.getReferrers('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2164"},"core/src/lib/Types.ts:2164"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tojsonstringargs"},(0,t.yg)("a",{id:"tojsonstring"}),(0,t.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,t.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,t.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"Note: Please be aware that using ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,t.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1944"},"core/src/lib/Types.ts:1944"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tostringnode"},(0,t.yg)("a",{id:"tostringnode"}),(0,t.yg)("strong",{parentName:"h3"},"toStringNode"),"()"),(0,t.yg)("p",null,"convert to an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object if this node is a string node.\nThe ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object supports querying the string content\ninside the string node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapStringNode")),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1922"},"core/src/lib/Types.ts:1922"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[4573],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var p=r.createContext({}),g=function(e){var a=r.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):o(o({},a),e)),n},s=function(e){var a=g(e.components);return r.createElement(p.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},d=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,i=e.originalType,p=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),c=g(n),d=t,y=c["".concat(p,".").concat(d)]||c[d]||m[d]||i;return n?r.createElement(y,o(o({ref:a},s),{},{components:n})):r.createElement(y,o({ref:a},s))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var i=n.length,o=new Array(i);o[0]=d;var l={};for(var p in a)hasOwnProperty.call(a,p)&&(l[p]=a[p]);l.originalType=e,l[c]="string"==typeof e?e:t,o[1]=l;for(var g=2;g{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>o,default:()=>m,frontMatter:()=>i,metadata:()=>l,toc:()=>g});var r=n(8168),t=(n(6540),n(5680));const i={id:"core_src.IHeapNode",title:"Interface: IHeapNode",sidebar_label:"IHeapNode",custom_edit_url:null},o=void 0,l={unversionedId:"api/interfaces/core_src.IHeapNode",id:"api/interfaces/core_src.IHeapNode",title:"Interface: IHeapNode",description:"An IHeapNode instance represents a JS heap object in a heap snapshot.",source:"@site/docs/api/interfaces/core_src.IHeapNode.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNode",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapNode",title:"Interface: IHeapNode",sidebar_label:"IHeapNode",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapLocation",permalink:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},next:{title:"IHeapNodes",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNodes"}},p={},g=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Properties",id:"properties",level:2},{value:' dominatorNode: Nullable<IHeapNode>',id:"-dominatornode-nullableiheapnode",level:3},{value:' edge_count: number',id:"-edge_count-number",level:3},{value:' hasPathEdge: boolean',id:"-haspathedge-boolean",level:3},{value:' id: number',id:"-id-number",level:3},{value:' isString: boolean',id:"-isstring-boolean",level:3},{value:' is_detached: boolean',id:"-is_detached-boolean",level:3},{value:' location: Nullable<IHeapLocation>',id:"-location-nullableiheaplocation",level:3},{value:' name: string',id:"-name-string",level:3},{value:' nodeIndex: number',id:"-nodeindex-number",level:3},{value:' numOfReferrers: number',id:"-numofreferrers-number",level:3},{value:' pathEdge: null | IHeapEdge',id:"-pathedge-null--iheapedge",level:3},{value:' references: IHeapEdge[]',id:"-references-iheapedge",level:3},{value:' referrers: IHeapEdge[]',id:"-referrers-iheapedge",level:3},{value:' retainedSize: number',id:"-retainedsize-number",level:3},{value:' self_size: number',id:"-self_size-number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:' type: string',id:"-type-string",level:3},{value:"Methods",id:"methods",level:2},{value:'findAnyReference(predicate)',id:"findanyreferencepredicate",level:3},{value:'findAnyReferrer(predicate)',id:"findanyreferrerpredicate",level:3},{value:'findAnyReferrerNode(predicate)',id:"findanyreferrernodepredicate",level:3},{value:'findReferrerNodes(predicate)',id:"findreferrernodespredicate",level:3},{value:'findReferrers(predicate)',id:"findreferrerspredicate",level:3},{value:'forEachReference(callback)',id:"foreachreferencecallback",level:3},{value:'forEachReferrer(callback)',id:"foreachreferrercallback",level:3},{value:'getAnyReferrer(edgeName, edgeType?)',id:"getanyreferreredgename-edgetype",level:3},{value:'getAnyReferrerNode(edgeName, edgeType?)',id:"getanyreferrernodeedgename-edgetype",level:3},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'getReference(edgeName, edgeType?)',id:"getreferenceedgename-edgetype",level:3},{value:'getReferenceNode(edgeName, edgeType?)',id:"getreferencenodeedgename-edgetype",level:3},{value:'getReferrerNodes(edgeName, edgeType?)',id:"getreferrernodesedgename-edgetype",level:3},{value:'getReferrers(edgeName, edgeType?)',id:"getreferrersedgename-edgetype",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3},{value:'toStringNode()',id:"tostringnode",level:3}],s={toc:g},c="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(c,(0,r.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"An ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapNode")," instance represents a JS heap object in a heap snapshot.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapNode")," instance"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each node (heap object)\n heap.nodes.forEach((node: IHeapNode, i: number) => {\n // use the heap node APIs here\n const id = node.id;\n const type = node.type;\n // ...\n });\n})();\n")),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("inlineCode",{parentName:"p"},"IHeapNodeBasic")),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"IHeapNode"))),(0,t.yg)("p",{parentName:"li"},"\u21b3\u21b3 ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapStringNode"))))),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-dominatornode-nullableiheapnode"},(0,t.yg)("a",{id:"dominatornode",name:"dominatornode"})," ",(0,t.yg)("strong",{parentName:"h3"},"dominatorNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"),(0,t.yg)("p",null,"get the dominator node of this node. If the dominator node gets released\nthere will be no path from GC to this node, and therefore this node can\nalso be released.\nFor more information on what a dominator node is, please check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1904"},"core/src/lib/Types.ts:1904"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-edge_count-number"},(0,t.yg)("a",{id:"edge\\_count",name:"edge\\_count"})," ",(0,t.yg)("strong",{parentName:"h3"},"edge","_","count"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of outgoing JS references (including engine-internal,\nnative, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1858"},"core/src/lib/Types.ts:1858"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-haspathedge-boolean"},(0,t.yg)("a",{id:"haspathedge",name:"haspathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"hasPathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"returns true if the heap node has been set an incoming edge\nwhich leads to the parent node on the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1880"},"core/src/lib/Types.ts:1880"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-id-number"},(0,t.yg)("a",{id:"id",name:"id"})," ",(0,t.yg)("strong",{parentName:"h3"},"id"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"unique id of the heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1785"},"core/src/lib/Types.ts:1785"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-isstring-boolean"},(0,t.yg)("a",{id:"isstring",name:"isstring"})," ",(0,t.yg)("strong",{parentName:"h3"},"isString"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"check if this a string node (normal string node, concatenated string node\nor sliced string node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1916"},"core/src/lib/Types.ts:1916"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-is_detached-boolean"},(0,t.yg)("a",{id:"is\\_detached",name:"is\\_detached"})," ",(0,t.yg)("strong",{parentName:"h3"},"is","_","detached"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a DOM element and the DOM element is detached\nfrom the DOM tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a React Fiber node and the Fiber node is unmounted\nfrom the React Fiber tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";\notherwise it will be ",(0,t.yg)("inlineCode",{parentName:"p"},"false"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1840"},"core/src/lib/Types.ts:1840"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-location-nullableiheaplocation"},(0,t.yg)("a",{id:"location",name:"location"})," ",(0,t.yg)("strong",{parentName:"h3"},"location"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapLocation")),">"),(0,t.yg)("p",null,"source location information of this heap object (if it is recorded by\nthe heap snapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1909"},"core/src/lib/Types.ts:1909"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-name-string"},(0,t.yg)("a",{id:"name",name:"name"})," ",(0,t.yg)("strong",{parentName:"h3"},"name"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"this is the ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," field associated with the heap object,\nfor JS object instances (type ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),"), ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the constructor's name\nof the object instance. for ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the string value."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1781"},"core/src/lib/Types.ts:1781"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-nodeindex-number"},(0,t.yg)("a",{id:"nodeindex",name:"nodeindex"})," ",(0,t.yg)("strong",{parentName:"h3"},"nodeIndex"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"index of this heap object inside the ",(0,t.yg)("inlineCode",{parentName:"p"},"node.snapshot.nodes")," pseudo array"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1889"},"core/src/lib/Types.ts:1889"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-numofreferrers-number"},(0,t.yg)("a",{id:"numofreferrers",name:"numofreferrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"numOfReferrers"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"Get the number of all incoming references pointing to this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1875"},"core/src/lib/Types.ts:1875"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-pathedge-null--iheapedge"},(0,t.yg)("a",{id:"pathedge",name:"pathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"pathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"null")," ","|"," ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))),(0,t.yg)("p",null,"The incoming edge which leads to the parent node\non the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1885"},"core/src/lib/Types.ts:1885"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-references-iheapedge"},(0,t.yg)("a",{id:"references",name:"references"})," ",(0,t.yg)("strong",{parentName:"h3"},"references"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all outgoing JS references from this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1865"},"core/src/lib/Types.ts:1865"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-referrers-iheapedge"},(0,t.yg)("a",{id:"referrers",name:"referrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"referrers"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all incoming JS references pointing to this heap\nobject (including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1870"},"core/src/lib/Types.ts:1870"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-retainedsize-number"},(0,t.yg)("a",{id:"retainedsize",name:"retainedsize"})," ",(0,t.yg)("strong",{parentName:"h3"},"retainedSize"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"retained size")," of the heap object (i.e., the total size of memory that\ncould be released if this object is released). For difference between\n",(0,t.yg)("strong",{parentName:"p"},"retained size")," and ",(0,t.yg)("strong",{parentName:"p"},"shallow size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1896"},"core/src/lib/Types.ts:1896"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-self_size-number"},(0,t.yg)("a",{id:"self\\_size",name:"self\\_size"})," ",(0,t.yg)("strong",{parentName:"h3"},"self","_","size"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"shallow size")," of the heap object (i.e., the size of memory that is held\nby the object itself.). For difference between ",(0,t.yg)("strong",{parentName:"p"},"shallow size")," and\n",(0,t.yg)("strong",{parentName:"p"},"retained size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1853"},"core/src/lib/Types.ts:1853"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,t.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,t.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,t.yg)("p",null,"get the ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1832"},"core/src/lib/Types.ts:1832"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-type-string"},(0,t.yg)("a",{id:"type",name:"type"})," ",(0,t.yg)("strong",{parentName:"h3"},"type"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"the type of the heap node object. All possible types:\nThis is engine-specific, for example all types in V8:\n",(0,t.yg)("inlineCode",{parentName:"p"},"hidden"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"array"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"code"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"closure"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"regexp"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"number"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"native"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"synthetic"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"concatenated string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"sliced string"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"symbol"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"bigint")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1775"},"core/src/lib/Types.ts:1775"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"findanyreferencepredicate"},(0,t.yg)("a",{id:"findanyreference"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\nin the hosting node (or outgoing edges from the node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first outgoing edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const reference = node.findAnyReference((edge: IHeapEdge) => {\n // find the outgoing reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1997"},"core/src/lib/Types.ts:1997"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrerpredicate"},(0,t.yg)("a",{id:"findanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node) until the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first incoming edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrer((edge: IHeapEdge) => {\n // find the incoming reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2014"},"core/src/lib/Types.ts:2014"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrernodepredicate"},(0,t.yg)("a",{id:"findanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each incoming JavaScript heap object"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the first referring node for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such node is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrerNode((node: IHeapNode) => {\n // find the referring node with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2032"},"core/src/lib/Types.ts:2032"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrernodespredicate"},(0,t.yg)("a",{id:"findreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each referrer nodes"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing all the referrer nodes for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nnode is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrerNodes = node.findReferrerNodes((node: IHeapNode) => {\n // find all the referring nodes with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2067"},"core/src/lib/Types.ts:2067"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrerspredicate"},(0,t.yg)("a",{id:"findreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nedge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrers = node.findReferrers((edge: IHeapEdge) => {\n // find all the incoming references with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2049"},"core/src/lib/Types.ts:2049"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferencecallback"},(0,t.yg)("a",{id:"foreachreference"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference in the\nhosting node (or outgoing edges from the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReference((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.references list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1962"},"core/src/lib/Types.ts:1962"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferrercallback"},(0,t.yg)("a",{id:"foreachreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference pointing\nto the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReferrer((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.referrers list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1980"},"core/src/lib/Types.ts:1980"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferreredgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the incoming edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS reference named \"ref\" pointing to node\nconst reference = node.getAnyReferrer('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2122"},"core/src/lib/Types.ts:2122"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferrernodeedgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds one of the incoming JS\nreferences pointing to the hosting node, and returns the JS heap object\ncontaining the incoming reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node containing the incoming JS reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst n1 = node.getAnyReferrerNode('ref', 'property');\n// this is equivalent to\nconst n2 = node.getAnyReferrer('ref', 'property')?.fromNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2145"},"core/src/lib/Types.ts:2145"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getjsonifyableobject"},(0,t.yg)("a",{id:"getjsonifyableobject"}),(0,t.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,t.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1931"},"core/src/lib/Types.ts:1931"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferenceedgename-edgetype"},(0,t.yg)("a",{id:"getreference"}),(0,t.yg)("strong",{parentName:"h3"},"getReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an outgoing JS\nreference from the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the outgoing edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the internal reference to node's hidden class\nconst reference = node.getReference('map', 'hidden');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2082"},"core/src/lib/Types.ts:2082"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferencenodeedgename-edgetype"},(0,t.yg)("a",{id:"getreferencenode"}),(0,t.yg)("strong",{parentName:"h3"},"getReferenceNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds the outgoing JS\nreference from the hosting node, and returns the JS heap object pointed to\nby the outgoing JS reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node pointed to by the outgoing reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the node's hidden class\nconst hiddenClassNode = node.getReferenceNode('map', 'hidden');\n// this is equivalent to\nconst hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2104"},"core/src/lib/Types.ts:2104"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrernodesedgename-edgetype"},(0,t.yg)("a",{id:"getreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all of the incoming JS\nreferences pointing to the hosting node, and returns an array containing\nthe hosting node for each of the incoming JS references."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing the hosting nodes, with each node corresponds\nto each incoming JS reference that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst nodes1 = node.getReferrerNodes('ref', 'property');\n// this is equivalent to\nconst nodes2 = node.getReferrers('ref', 'property')\n .map(edge => edge.fromNode);\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2185"},"core/src/lib/Types.ts:2185"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrersedgename-edgetype"},(0,t.yg)("a",{id:"getreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all the incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges that\nmeet the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of of the JS reference named \"ref\" pointing to node\nconst referrers = node.getReferrers('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2164"},"core/src/lib/Types.ts:2164"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tojsonstringargs"},(0,t.yg)("a",{id:"tojsonstring"}),(0,t.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,t.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,t.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"Note: Please be aware that using ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,t.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1944"},"core/src/lib/Types.ts:1944"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tostringnode"},(0,t.yg)("a",{id:"tostringnode"}),(0,t.yg)("strong",{parentName:"h3"},"toStringNode"),"()"),(0,t.yg)("p",null,"convert to an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object if this node is a string node.\nThe ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object supports querying the string content\ninside the string node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapStringNode")),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1922"},"core/src/lib/Types.ts:1922"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1bb76b7a.56f5a672.js b/assets/js/1bb76b7a.1a3042ad.js similarity index 91% rename from assets/js/1bb76b7a.56f5a672.js rename to assets/js/1bb76b7a.1a3042ad.js index 6b7fba386..306a5ae8c 100644 --- a/assets/js/1bb76b7a.56f5a672.js +++ b/assets/js/1bb76b7a.1a3042ad.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2915],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>d});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),y=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},c=function(e){var a=y(e.components);return t.createElement(o.Provider,{value:a},e.children)},p="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,r=e.originalType,o=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),p=y(n),m=s,d=p["".concat(o,".").concat(m)]||p[m]||u[m]||r;return n?t.createElement(d,l(l({ref:a},c),{},{components:n})):t.createElement(d,l({ref:a},c))}));function d(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var r=n.length,l=new Array(r);l[0]=m;var i={};for(var o in a)hasOwnProperty.call(a,o)&&(i[o]=a[o]);i.originalType=e,i[p]="string"==typeof e?e:s,l[1]=i;for(var y=2;y{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>y});var t=n(8168),s=(n(6540),n(5680));const r={id:"heap_analysis_src.ObjectUnboundGrowthAnalysis",title:"Class: ObjectUnboundGrowthAnalysis",sidebar_label:"ObjectUnboundGrowthAnalysis",custom_edit_url:null},l=void 0,i={unversionedId:"api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",id:"api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",title:"Class: ObjectUnboundGrowthAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectUnboundGrowthAnalysis",title:"Class: ObjectUnboundGrowthAnalysis",sidebar_label:"ObjectUnboundGrowthAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectSizeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"},next:{title:"ShapeUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"}},o={},y=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectUnboundGrowthAnalysis()',id:"new-objectunboundgrowthanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotsInDirectory(directory, options?)',id:"analyzesnapshotsindirectorydirectory-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],c={toc:y},p="wrapper";function u(e){let{components:a,...n}=e;return(0,s.yg)(p,(0,t.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ObjectUnboundGrowthAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-objectunboundgrowthanalysis"},(0,s.yg)("a",{id:"new objectunboundgrowthanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ObjectUnboundGrowthAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotsindirectorydirectory-options"},(0,s.yg)("a",{id:"analyzesnapshotsindirectory"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotsInDirectory"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"directory"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a series of heap snapshot files"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"directory"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory holding a series of ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," files, all snapshot files will be loaded and analyzed in the alphanumerically ascending order of those snapshot file names."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory);\n// query analysis-specific and structured results\nconst shapes = analysis.getShapesWithUnboundGrowth();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L148"},"heap-analysis/src/BaseAnalysis.ts:148"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ObjectUnboundGrowthAnalysis.ts#L33"},"heap-analysis/src/plugins/ObjectUnboundGrowthAnalysis.ts:33"))))))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2915],{5680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>d});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),y=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},p=function(e){var a=y(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,r=e.originalType,o=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=y(n),m=s,d=c["".concat(o,".").concat(m)]||c[m]||u[m]||r;return n?t.createElement(d,l(l({ref:a},p),{},{components:n})):t.createElement(d,l({ref:a},p))}));function d(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var r=n.length,l=new Array(r);l[0]=m;var i={};for(var o in a)hasOwnProperty.call(a,o)&&(i[o]=a[o]);i.originalType=e,i[c]="string"==typeof e?e:s,l[1]=i;for(var y=2;y{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>y});var t=n(8168),s=(n(6540),n(5680));const r={id:"heap_analysis_src.ObjectUnboundGrowthAnalysis",title:"Class: ObjectUnboundGrowthAnalysis",sidebar_label:"ObjectUnboundGrowthAnalysis",custom_edit_url:null},l=void 0,i={unversionedId:"api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",id:"api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",title:"Class: ObjectUnboundGrowthAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectUnboundGrowthAnalysis",title:"Class: ObjectUnboundGrowthAnalysis",sidebar_label:"ObjectUnboundGrowthAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectSizeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"},next:{title:"ShapeUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"}},o={},y=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectUnboundGrowthAnalysis()',id:"new-objectunboundgrowthanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotsInDirectory(directory, options?)',id:"analyzesnapshotsindirectorydirectory-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],p={toc:y},c="wrapper";function u(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,t.A)({},p,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ObjectUnboundGrowthAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-objectunboundgrowthanalysis"},(0,s.yg)("a",{id:"new objectunboundgrowthanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ObjectUnboundGrowthAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotsindirectorydirectory-options"},(0,s.yg)("a",{id:"analyzesnapshotsindirectory"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotsInDirectory"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"directory"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a series of heap snapshot files"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"directory"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory holding a series of ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," files, all snapshot files will be loaded and analyzed in the alphanumerically ascending order of those snapshot file names."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory);\n// query analysis-specific and structured results\nconst shapes = analysis.getShapesWithUnboundGrowth();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L148"},"heap-analysis/src/BaseAnalysis.ts:148"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ObjectUnboundGrowthAnalysis.ts#L33"},"heap-analysis/src/plugins/ObjectUnboundGrowthAnalysis.ts:33"))))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1be78505.c37e911a.js b/assets/js/1be78505.70c35879.js similarity index 99% rename from assets/js/1be78505.c37e911a.js rename to assets/js/1be78505.70c35879.js index 8bb72214b..c0300d272 100644 --- a/assets/js/1be78505.c37e911a.js +++ b/assets/js/1be78505.70c35879.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8714,1774],{8067:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ge});var a=n(6540),l=n(53),o=n(1754),r=n(2967),c=n(9024),i=n(7559),s=n(2252),d=n(6588),m=n(8916),u=n(1312),b=n(3104),p=n(5062);const h={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};function E(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,l]=(0,a.useState)(!1),o=(0,a.useRef)(!1),{startScroll:r,cancelScroll:c}=(0,b.gk)();return(0,b.Mq)(((e,n)=>{let{scrollY:a}=e;const r=n?.scrollY;r&&(o.current?o.current=!1:a>=r?(c(),l(!1)):a{e.location.hash&&(o.current=!0,l(!1))})),{shown:n,scrollToTop:()=>r(0)}}({threshold:300});return a.createElement("button",{"aria-label":(0,u.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,l.A)("clean-btn",i.G.common.backToTopButton,h.backToTopButton,e&&h.backToTopButtonShow),type:"button",onClick:t})}var f=n(6347),g=n(4581),v=n(6342),_=n(3465),C=n(8168);function k(e){return a.createElement("svg",(0,C.A)({width:"20",height:"20","aria-hidden":"true"},e),a.createElement("g",{fill:"#7a7a7a"},a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))}const A="collapseSidebarButton_PEFL",S="collapseSidebarButtonIcon_kv0_";function N(e){let{onClick:t}=e;return a.createElement("button",{type:"button",title:(0,u.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,u.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,l.A)("button button--secondary button--outline",A),onClick:t},a.createElement(k,{className:S}))}var T=n(5041),I=n(9532);const x=Symbol("EmptyContext"),y=a.createContext(x);function w(e){let{children:t}=e;const[n,l]=(0,a.useState)(null),o=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:l})),[n]);return a.createElement(y.Provider,{value:o},t)}var B=n(9169),M=n(1422),L=n(5489),P=n(2303);function G(e){let{categoryLabel:t,onClick:n}=e;return a.createElement("button",{"aria-label":(0,u.T)({id:"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel",message:"Toggle the collapsible sidebar category '{label}'",description:"The ARIA label to toggle the collapsible sidebar category"},{label:t}),type:"button",className:"clean-btn menu__caret",onClick:n})}function H(e){let{item:t,onItemClick:n,activePath:r,level:c,index:s,...d}=e;const{items:m,label:u,collapsible:b,className:p,href:h}=t,{docs:{sidebar:{autoCollapseCategories:E}}}=(0,v.p)(),f=function(e){const t=(0,P.A)();return(0,a.useMemo)((()=>e.href?e.href:!t&&e.collapsible?(0,o._o)(e):void 0),[e,t])}(t),g=(0,o.w8)(t,r),_=(0,B.ys)(h,r),{collapsed:k,setCollapsed:A}=(0,M.u)({initialState:()=>!!b&&(!g&&t.collapsed)}),{expandedItem:S,setExpandedItem:N}=function(){const e=(0,a.useContext)(y);if(e===x)throw new I.dV("DocSidebarItemsExpandedStateProvider");return e}(),T=function(e){void 0===e&&(e=!k),N(e?null:s),A(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:l}=e;const o=(0,I.ZC)(t);(0,a.useEffect)((()=>{t&&!o&&n&&l(!1)}),[t,o,n,l])}({isActive:g,collapsed:k,updateCollapsed:T}),(0,a.useEffect)((()=>{b&&S&&S!==s&&E&&A(!0)}),[b,S,s,A,E]),a.createElement("li",{className:(0,l.A)(i.G.docs.docSidebarItemCategory,i.G.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":k},p)},a.createElement("div",{className:(0,l.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":_})},a.createElement(L.A,(0,C.A)({className:(0,l.A)("menu__link",{"menu__link--sublist":b,"menu__link--sublist-caret":!h&&b,"menu__link--active":g}),onClick:b?e=>{n?.(t),h?T(!1):(e.preventDefault(),T())}:()=>{n?.(t)},"aria-current":_?"page":void 0,"aria-expanded":b?!k:void 0,href:b?f??"#":f},d),u),h&&b&&a.createElement(G,{categoryLabel:u,onClick:e=>{e.preventDefault(),T()}})),a.createElement(M.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:k},a.createElement(K,{items:m,tabIndex:k?-1:0,onItemClick:n,activePath:r,level:c+1})))}var F=n(6654),W=n(2523);const D="menuExternalLink_NmtK";function z(e){let{item:t,onItemClick:n,activePath:r,level:c,index:s,...d}=e;const{href:m,label:u,className:b}=t,p=(0,o.w8)(t,r),h=(0,F.A)(m);return a.createElement("li",{className:(0,l.A)(i.G.docs.docSidebarItemLink,i.G.docs.docSidebarItemLinkLevel(c),"menu__list-item",b),key:u},a.createElement(L.A,(0,C.A)({className:(0,l.A)("menu__link",!h&&D,{"menu__link--active":p}),"aria-current":p?"page":void 0,to:m},h&&{onClick:n?()=>n(t):void 0},d),u,!h&&a.createElement(W.A,null)))}const R="menuHtmlItem_M9Kj";function U(e){let{item:t,level:n,index:o}=e;const{value:r,defaultStyle:c,className:s}=t;return a.createElement("li",{className:(0,l.A)(i.G.docs.docSidebarItemLink,i.G.docs.docSidebarItemLinkLevel(n),c&&[R,"menu__list-item"],s),key:o,dangerouslySetInnerHTML:{__html:r}})}function V(e){let{item:t,...n}=e;switch(t.type){case"category":return a.createElement(H,(0,C.A)({item:t},n));case"html":return a.createElement(U,(0,C.A)({item:t},n));default:return a.createElement(z,(0,C.A)({item:t},n))}}function j(e){let{items:t,...n}=e;return a.createElement(w,null,t.map(((e,t)=>a.createElement(V,(0,C.A)({key:t,item:e,index:t},n)))))}const K=(0,a.memo)(j),q="menu_SIkG",Y="menuWithAnnouncementBar_GW3s";function O(e){let{path:t,sidebar:n,className:o}=e;const r=function(){const{isActive:e}=(0,T.Mj)(),[t,n]=(0,a.useState)(e);return(0,b.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return a.createElement("nav",{className:(0,l.A)("menu thin-scrollbar",q,r&&Y,o)},a.createElement("ul",{className:(0,l.A)(i.G.docs.docSidebarMenu,"menu__list")},a.createElement(K,{items:n,activePath:t,level:1})))}const X="sidebar_njMd",Z="sidebarWithHideableNavbar_wUlq",$="sidebarHidden_VK0M",J="sidebarLogo_isFc";function Q(e){let{path:t,sidebar:n,onCollapse:o,isHidden:r}=e;const{navbar:{hideOnScroll:c},docs:{sidebar:{hideable:i}}}=(0,v.p)();return a.createElement("div",{className:(0,l.A)(X,c&&Z,r&&$)},c&&a.createElement(_.A,{tabIndex:-1,className:J}),a.createElement(O,{path:t,sidebar:n}),i&&a.createElement(N,{onClick:o}))}const ee=a.memo(Q);var te=n(9876),ne=n(5600);const ae=e=>{let{sidebar:t,path:n}=e;const o=(0,te.M)();return a.createElement("ul",{className:(0,l.A)(i.G.docs.docSidebarMenu,"menu__list")},a.createElement(K,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&o.toggle(),"link"===e.type&&o.toggle()},level:1}))};function le(e){return a.createElement(ne.GX,{component:ae,props:e})}const oe=a.memo(le);function re(e){const t=(0,g.l)(),n="desktop"===t||"ssr"===t,l="mobile"===t;return a.createElement(a.Fragment,null,n&&a.createElement(ee,e),l&&a.createElement(oe,e))}const ce={expandButton:"expandButton_m80_",expandButtonIcon:"expandButtonIcon_BlDH"};function ie(e){let{toggleSidebar:t}=e;return a.createElement("div",{className:ce.expandButton,title:(0,u.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,u.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t},a.createElement(k,{className:ce.expandButtonIcon}))}const se={docSidebarContainer:"docSidebarContainer_b6E3",docSidebarContainerHidden:"docSidebarContainerHidden_b3ry"};function de(e){let{children:t}=e;const n=(0,d.t)();return a.createElement(a.Fragment,{key:n?.name??"noSidebar"},t)}function me(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:o}=e;const{pathname:r}=(0,f.zy)(),[c,s]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{c&&s(!1),o((e=>!e))}),[o,c]);return a.createElement("aside",{className:(0,l.A)(i.G.docs.docSidebarContainer,se.docSidebarContainer,n&&se.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(se.docSidebarContainer)&&n&&s(!0)}},a.createElement(de,null,a.createElement(re,{sidebar:t,path:r,onCollapse:d,isHidden:c})),c&&a.createElement(ie,{toggleSidebar:d}))}const ue={docMainContainer:"docMainContainer_gTbr",docMainContainerEnhanced:"docMainContainerEnhanced_Uz_u",docItemWrapperEnhanced:"docItemWrapperEnhanced_czyv"};function be(e){let{hiddenSidebarContainer:t,children:n}=e;const o=(0,d.t)();return a.createElement("main",{className:(0,l.A)(ue.docMainContainer,(t||!o)&&ue.docMainContainerEnhanced)},a.createElement("div",{className:(0,l.A)("container padding-top--md padding-bottom--lg",ue.docItemWrapper,t&&ue.docItemWrapperEnhanced)},n))}const pe={docPage:"docPage__5DB",docsWrapper:"docsWrapper_BCFX"};function he(e){let{children:t}=e;const n=(0,d.t)(),[l,o]=(0,a.useState)(!1);return a.createElement(m.A,{wrapperClassName:pe.docsWrapper},a.createElement(E,null),a.createElement("div",{className:pe.docPage},n&&a.createElement(me,{sidebar:n.items,hiddenSidebarContainer:l,setHiddenSidebarContainer:o}),a.createElement(be,{hiddenSidebarContainer:l},t)))}var Ee=n(1774),fe=n(1463);function ge(e){const{versionMetadata:t}=e,n=(0,o.mz)(e);if(!n)return a.createElement(Ee.default,null);const{docElement:m,sidebarName:u,sidebarItems:b}=n;return a.createElement(a.Fragment,null,a.createElement(fe.A,{version:t.version,tag:(0,r.tU)(t.pluginId,t.version)}),a.createElement(c.e3,{className:(0,l.A)(i.G.wrapper.docsPages,i.G.page.docsDocPage,e.versionMetadata.className)},a.createElement(s.n,{version:t},a.createElement(d.V,{name:u,items:b},a.createElement(he,null,m)))))}},1774:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(6540),l=n(1312),o=n(9024),r=n(8916);function c(){return a.createElement(a.Fragment,null,a.createElement(o.be,{title:(0,l.T)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.A,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(l.A,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(l.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(l.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}},2252:(e,t,n)=>{n.d(t,{n:()=>r,r:()=>c});var a=n(6540),l=n(9532);const o=a.createContext(null);function r(e){let{children:t,version:n}=e;return a.createElement(o.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(o);if(null===e)throw new l.dV("DocsVersionProvider");return e}}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1774,8714],{8067:(e,t,n)=>{n.r(t),n.d(t,{default:()=>ge});var a=n(6540),l=n(53),o=n(1754),r=n(2967),c=n(9024),i=n(7559),s=n(2252),d=n(6588),m=n(8916),u=n(1312),b=n(3104),p=n(5062);const h={backToTopButton:"backToTopButton_sjWU",backToTopButtonShow:"backToTopButtonShow_xfvO"};function E(){const{shown:e,scrollToTop:t}=function(e){let{threshold:t}=e;const[n,l]=(0,a.useState)(!1),o=(0,a.useRef)(!1),{startScroll:r,cancelScroll:c}=(0,b.gk)();return(0,b.Mq)(((e,n)=>{let{scrollY:a}=e;const r=n?.scrollY;r&&(o.current?o.current=!1:a>=r?(c(),l(!1)):a{e.location.hash&&(o.current=!0,l(!1))})),{shown:n,scrollToTop:()=>r(0)}}({threshold:300});return a.createElement("button",{"aria-label":(0,u.T)({id:"theme.BackToTopButton.buttonAriaLabel",message:"Scroll back to top",description:"The ARIA label for the back to top button"}),className:(0,l.A)("clean-btn",i.G.common.backToTopButton,h.backToTopButton,e&&h.backToTopButtonShow),type:"button",onClick:t})}var f=n(6347),g=n(4581),v=n(6342),_=n(3465),C=n(8168);function k(e){return a.createElement("svg",(0,C.A)({width:"20",height:"20","aria-hidden":"true"},e),a.createElement("g",{fill:"#7a7a7a"},a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"})))}const A="collapseSidebarButton_PEFL",S="collapseSidebarButtonIcon_kv0_";function N(e){let{onClick:t}=e;return a.createElement("button",{type:"button",title:(0,u.T)({id:"theme.docs.sidebar.collapseButtonTitle",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),"aria-label":(0,u.T)({id:"theme.docs.sidebar.collapseButtonAriaLabel",message:"Collapse sidebar",description:"The title attribute for collapse button of doc sidebar"}),className:(0,l.A)("button button--secondary button--outline",A),onClick:t},a.createElement(k,{className:S}))}var T=n(5041),I=n(9532);const x=Symbol("EmptyContext"),y=a.createContext(x);function w(e){let{children:t}=e;const[n,l]=(0,a.useState)(null),o=(0,a.useMemo)((()=>({expandedItem:n,setExpandedItem:l})),[n]);return a.createElement(y.Provider,{value:o},t)}var B=n(9169),M=n(1422),L=n(5489),P=n(2303);function G(e){let{categoryLabel:t,onClick:n}=e;return a.createElement("button",{"aria-label":(0,u.T)({id:"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel",message:"Toggle the collapsible sidebar category '{label}'",description:"The ARIA label to toggle the collapsible sidebar category"},{label:t}),type:"button",className:"clean-btn menu__caret",onClick:n})}function H(e){let{item:t,onItemClick:n,activePath:r,level:c,index:s,...d}=e;const{items:m,label:u,collapsible:b,className:p,href:h}=t,{docs:{sidebar:{autoCollapseCategories:E}}}=(0,v.p)(),f=function(e){const t=(0,P.A)();return(0,a.useMemo)((()=>e.href?e.href:!t&&e.collapsible?(0,o._o)(e):void 0),[e,t])}(t),g=(0,o.w8)(t,r),_=(0,B.ys)(h,r),{collapsed:k,setCollapsed:A}=(0,M.u)({initialState:()=>!!b&&(!g&&t.collapsed)}),{expandedItem:S,setExpandedItem:N}=function(){const e=(0,a.useContext)(y);if(e===x)throw new I.dV("DocSidebarItemsExpandedStateProvider");return e}(),T=function(e){void 0===e&&(e=!k),N(e?null:s),A(e)};return function(e){let{isActive:t,collapsed:n,updateCollapsed:l}=e;const o=(0,I.ZC)(t);(0,a.useEffect)((()=>{t&&!o&&n&&l(!1)}),[t,o,n,l])}({isActive:g,collapsed:k,updateCollapsed:T}),(0,a.useEffect)((()=>{b&&S&&S!==s&&E&&A(!0)}),[b,S,s,A,E]),a.createElement("li",{className:(0,l.A)(i.G.docs.docSidebarItemCategory,i.G.docs.docSidebarItemCategoryLevel(c),"menu__list-item",{"menu__list-item--collapsed":k},p)},a.createElement("div",{className:(0,l.A)("menu__list-item-collapsible",{"menu__list-item-collapsible--active":_})},a.createElement(L.A,(0,C.A)({className:(0,l.A)("menu__link",{"menu__link--sublist":b,"menu__link--sublist-caret":!h&&b,"menu__link--active":g}),onClick:b?e=>{n?.(t),h?T(!1):(e.preventDefault(),T())}:()=>{n?.(t)},"aria-current":_?"page":void 0,"aria-expanded":b?!k:void 0,href:b?f??"#":f},d),u),h&&b&&a.createElement(G,{categoryLabel:u,onClick:e=>{e.preventDefault(),T()}})),a.createElement(M.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:k},a.createElement(K,{items:m,tabIndex:k?-1:0,onItemClick:n,activePath:r,level:c+1})))}var F=n(6654),W=n(2523);const D="menuExternalLink_NmtK";function z(e){let{item:t,onItemClick:n,activePath:r,level:c,index:s,...d}=e;const{href:m,label:u,className:b}=t,p=(0,o.w8)(t,r),h=(0,F.A)(m);return a.createElement("li",{className:(0,l.A)(i.G.docs.docSidebarItemLink,i.G.docs.docSidebarItemLinkLevel(c),"menu__list-item",b),key:u},a.createElement(L.A,(0,C.A)({className:(0,l.A)("menu__link",!h&&D,{"menu__link--active":p}),"aria-current":p?"page":void 0,to:m},h&&{onClick:n?()=>n(t):void 0},d),u,!h&&a.createElement(W.A,null)))}const R="menuHtmlItem_M9Kj";function U(e){let{item:t,level:n,index:o}=e;const{value:r,defaultStyle:c,className:s}=t;return a.createElement("li",{className:(0,l.A)(i.G.docs.docSidebarItemLink,i.G.docs.docSidebarItemLinkLevel(n),c&&[R,"menu__list-item"],s),key:o,dangerouslySetInnerHTML:{__html:r}})}function V(e){let{item:t,...n}=e;switch(t.type){case"category":return a.createElement(H,(0,C.A)({item:t},n));case"html":return a.createElement(U,(0,C.A)({item:t},n));default:return a.createElement(z,(0,C.A)({item:t},n))}}function j(e){let{items:t,...n}=e;return a.createElement(w,null,t.map(((e,t)=>a.createElement(V,(0,C.A)({key:t,item:e,index:t},n)))))}const K=(0,a.memo)(j),q="menu_SIkG",Y="menuWithAnnouncementBar_GW3s";function O(e){let{path:t,sidebar:n,className:o}=e;const r=function(){const{isActive:e}=(0,T.Mj)(),[t,n]=(0,a.useState)(e);return(0,b.Mq)((t=>{let{scrollY:a}=t;e&&n(0===a)}),[e]),e&&t}();return a.createElement("nav",{className:(0,l.A)("menu thin-scrollbar",q,r&&Y,o)},a.createElement("ul",{className:(0,l.A)(i.G.docs.docSidebarMenu,"menu__list")},a.createElement(K,{items:n,activePath:t,level:1})))}const X="sidebar_njMd",Z="sidebarWithHideableNavbar_wUlq",$="sidebarHidden_VK0M",J="sidebarLogo_isFc";function Q(e){let{path:t,sidebar:n,onCollapse:o,isHidden:r}=e;const{navbar:{hideOnScroll:c},docs:{sidebar:{hideable:i}}}=(0,v.p)();return a.createElement("div",{className:(0,l.A)(X,c&&Z,r&&$)},c&&a.createElement(_.A,{tabIndex:-1,className:J}),a.createElement(O,{path:t,sidebar:n}),i&&a.createElement(N,{onClick:o}))}const ee=a.memo(Q);var te=n(9876),ne=n(5600);const ae=e=>{let{sidebar:t,path:n}=e;const o=(0,te.M)();return a.createElement("ul",{className:(0,l.A)(i.G.docs.docSidebarMenu,"menu__list")},a.createElement(K,{items:t,activePath:n,onItemClick:e=>{"category"===e.type&&e.href&&o.toggle(),"link"===e.type&&o.toggle()},level:1}))};function le(e){return a.createElement(ne.GX,{component:ae,props:e})}const oe=a.memo(le);function re(e){const t=(0,g.l)(),n="desktop"===t||"ssr"===t,l="mobile"===t;return a.createElement(a.Fragment,null,n&&a.createElement(ee,e),l&&a.createElement(oe,e))}const ce={expandButton:"expandButton_m80_",expandButtonIcon:"expandButtonIcon_BlDH"};function ie(e){let{toggleSidebar:t}=e;return a.createElement("div",{className:ce.expandButton,title:(0,u.T)({id:"theme.docs.sidebar.expandButtonTitle",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),"aria-label":(0,u.T)({id:"theme.docs.sidebar.expandButtonAriaLabel",message:"Expand sidebar",description:"The ARIA label and title attribute for expand button of doc sidebar"}),tabIndex:0,role:"button",onKeyDown:t,onClick:t},a.createElement(k,{className:ce.expandButtonIcon}))}const se={docSidebarContainer:"docSidebarContainer_b6E3",docSidebarContainerHidden:"docSidebarContainerHidden_b3ry"};function de(e){let{children:t}=e;const n=(0,d.t)();return a.createElement(a.Fragment,{key:n?.name??"noSidebar"},t)}function me(e){let{sidebar:t,hiddenSidebarContainer:n,setHiddenSidebarContainer:o}=e;const{pathname:r}=(0,f.zy)(),[c,s]=(0,a.useState)(!1),d=(0,a.useCallback)((()=>{c&&s(!1),o((e=>!e))}),[o,c]);return a.createElement("aside",{className:(0,l.A)(i.G.docs.docSidebarContainer,se.docSidebarContainer,n&&se.docSidebarContainerHidden),onTransitionEnd:e=>{e.currentTarget.classList.contains(se.docSidebarContainer)&&n&&s(!0)}},a.createElement(de,null,a.createElement(re,{sidebar:t,path:r,onCollapse:d,isHidden:c})),c&&a.createElement(ie,{toggleSidebar:d}))}const ue={docMainContainer:"docMainContainer_gTbr",docMainContainerEnhanced:"docMainContainerEnhanced_Uz_u",docItemWrapperEnhanced:"docItemWrapperEnhanced_czyv"};function be(e){let{hiddenSidebarContainer:t,children:n}=e;const o=(0,d.t)();return a.createElement("main",{className:(0,l.A)(ue.docMainContainer,(t||!o)&&ue.docMainContainerEnhanced)},a.createElement("div",{className:(0,l.A)("container padding-top--md padding-bottom--lg",ue.docItemWrapper,t&&ue.docItemWrapperEnhanced)},n))}const pe={docPage:"docPage__5DB",docsWrapper:"docsWrapper_BCFX"};function he(e){let{children:t}=e;const n=(0,d.t)(),[l,o]=(0,a.useState)(!1);return a.createElement(m.A,{wrapperClassName:pe.docsWrapper},a.createElement(E,null),a.createElement("div",{className:pe.docPage},n&&a.createElement(me,{sidebar:n.items,hiddenSidebarContainer:l,setHiddenSidebarContainer:o}),a.createElement(be,{hiddenSidebarContainer:l},t)))}var Ee=n(1774),fe=n(1463);function ge(e){const{versionMetadata:t}=e,n=(0,o.mz)(e);if(!n)return a.createElement(Ee.default,null);const{docElement:m,sidebarName:u,sidebarItems:b}=n;return a.createElement(a.Fragment,null,a.createElement(fe.A,{version:t.version,tag:(0,r.tU)(t.pluginId,t.version)}),a.createElement(c.e3,{className:(0,l.A)(i.G.wrapper.docsPages,i.G.page.docsDocPage,e.versionMetadata.className)},a.createElement(s.n,{version:t},a.createElement(d.V,{name:u,items:b},a.createElement(he,null,m)))))}},1774:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var a=n(6540),l=n(1312),o=n(9024),r=n(8916);function c(){return a.createElement(a.Fragment,null,a.createElement(o.be,{title:(0,l.T)({id:"theme.NotFound.title",message:"Page Not Found"})}),a.createElement(r.A,null,a.createElement("main",{className:"container margin-vert--xl"},a.createElement("div",{className:"row"},a.createElement("div",{className:"col col--6 col--offset-3"},a.createElement("h1",{className:"hero__title"},a.createElement(l.A,{id:"theme.NotFound.title",description:"The title of the 404 page"},"Page Not Found")),a.createElement("p",null,a.createElement(l.A,{id:"theme.NotFound.p1",description:"The first paragraph of the 404 page"},"We could not find what you were looking for.")),a.createElement("p",null,a.createElement(l.A,{id:"theme.NotFound.p2",description:"The 2nd paragraph of the 404 page"},"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))))}},2252:(e,t,n)=>{n.d(t,{n:()=>r,r:()=>c});var a=n(6540),l=n(9532);const o=a.createContext(null);function r(e){let{children:t,version:n}=e;return a.createElement(o.Provider,{value:n},t)}function c(){const e=(0,a.useContext)(o);if(null===e)throw new l.dV("DocsVersionProvider");return e}}}]); \ No newline at end of file diff --git a/assets/js/26eba521.2269d03f.js b/assets/js/26eba521.43522dbc.js similarity index 97% rename from assets/js/26eba521.2269d03f.js rename to assets/js/26eba521.43522dbc.js index 37f69e3b6..491efdf0a 100644 --- a/assets/js/26eba521.2269d03f.js +++ b/assets/js/26eba521.43522dbc.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[6571],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>y});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=t.createContext({}),g=function(e){var a=t.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},s=function(e){var a=g(e.components);return t.createElement(p.Provider,{value:a},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},d=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,l=e.originalType,p=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),m=g(n),d=r,y=m["".concat(p,".").concat(d)]||m[d]||c[d]||l;return n?t.createElement(y,i(i({ref:a},s),{},{components:n})):t.createElement(y,i({ref:a},s))}));function y(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=d;var o={};for(var p in a)hasOwnProperty.call(a,p)&&(o[p]=a[p]);o.originalType=e,o[m]="string"==typeof e?e:r,i[1]=o;for(var g=2;g{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>i,default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>g});var t=n(8168),r=(n(6540),n(5680));const l={id:"core_src",title:"Package: @memlab/core",sidebar_label:"core/src",sidebar_position:0,custom_edit_url:null},i=void 0,o={unversionedId:"api/modules/core_src",id:"api/modules/core_src",title:"Package: @memlab/core",description:"Interfaces",source:"@site/docs/api/modules/core_src.md",sourceDirName:"api/modules",slug:"/api/modules/core_src",permalink:"/memlab/docs/api/modules/core_src",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"core_src",title:"Package: @memlab/core",sidebar_label:"core/src",sidebar_position:0,custom_edit_url:null},sidebar:"sidebar",previous:{title:"api/src",permalink:"/memlab/docs/api/modules/api_src"},next:{title:"heap-analysis/src",permalink:"/memlab/docs/api/modules/heap_analysis_src"}},p={},g=[{value:"Interfaces",id:"interfaces",level:2},{value:"Type Aliases",id:"type-aliases",level:2},{value:' CheckPageLoadCallback: (page: Page) => Promise<boolean>',id:"-checkpageloadcallback-page-page--promiseboolean",level:3},{value:' Cookie: Object',id:"-cookie-object",level:3},{value:' Cookies: Cookie[]',id:"-cookies-cookie",level:3},{value:' EdgeIterationCallback: (edge: IHeapEdge) => Optional<{ stop: boolean }> | void',id:"-edgeiterationcallback-edge-iheapedge--optional-stop-boolean----void",level:3},{value:' InitLeakFilterCallback: (snapshot: IHeapSnapshot, leakedNodeIds: HeapNodeIdSet) => void',id:"-initleakfiltercallback-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--void",level:3},{value:' InteractionsCallback: (page: Page, args?: OperationArgs) => Promise<void>',id:"-interactionscallback-page-page-args-operationargs--promisevoid",level:3},{value:' LeakFilterCallback: (node: IHeapNode, snapshot: IHeapSnapshot, leakedNodeIds: HeapNodeIdSet) => boolean',id:"-leakfiltercallback-node-iheapnode-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--boolean",level:3},{value:' Nullable<T>: T | null',id:"-nullablet-t--null",level:3},{value:"Type parameters",id:"type-parameters",level:4},{value:' Optional<T>: T | null | undefined',id:"-optionalt-t--null--undefined",level:3},{value:"Type parameters",id:"type-parameters-1",level:4},{value:' Page: PuppeteerPage',id:"-page-puppeteerpage",level:3},{value:' Predicator<T>: (entity: T) => boolean',id:"-predicatort-entity-t--boolean",level:3},{value:"Type parameters",id:"type-parameters-2",level:4},{value:' ReferenceFilterCallback: (edge: IHeapEdge, snapshot: IHeapSnapshot, isReferenceUsedByDefault: boolean) => boolean',id:"-referencefiltercallback-edge-iheapedge-snapshot-iheapsnapshot-isreferenceusedbydefault-boolean--boolean",level:3},{value:' RunMetaInfo: Object',id:"-runmetainfo-object",level:3},{value:' Undefinable<T>: T | undefined',id:"-undefinablet-t--undefined",level:3},{value:"Type parameters",id:"type-parameters-3",level:4},{value:"Functions",id:"functions",level:2},{value:'dumpNodeHeapSnapshot()',id:"dumpnodeheapsnapshot",level:3},{value:'tagObject<T>(o, tag)',id:"tagobjectto-tag",level:3},{value:"Type parameters",id:"type-parameters-4",level:4},{value:'takeNodeMinimalHeap()',id:"takenodeminimalheap",level:3}],s={toc:g},m="wrapper";function c(e){let{components:a,...n}=e;return(0,r.yg)(m,(0,t.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("h2",{id:"interfaces"},"Interfaces"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"},"IBrowserInfo")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdges"},"IHeapEdges")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},"IHeapLocation")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNodes"},"IHeapNodes")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter"},"ILeakFilter")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IScenario"},"IScenario"))),(0,r.yg)("h2",{id:"type-aliases"},"Type Aliases"),(0,r.yg)("h3",{id:"-checkpageloadcallback-page-page--promiseboolean"},(0,r.yg)("a",{id:"checkpageloadcallback",name:"checkpageloadcallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"CheckPageLoadCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"page"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean"),">"),(0,r.yg)("p",null,"Callback function to provide if the page is loaded.\nFor concrete example, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#ispageloaded"},"isPageLoaded"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page"))," | puppeteer's ",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page/"},"Page")," object. To import this type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"p"},"boolean"),">"," | a boolean value, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),", memlab will consider\nthe navigation completes, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"false"),", memlab will keep calling\nthis callback until it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),". This is an async callback, you can\nalso ",(0,r.yg)("inlineCode",{parentName:"p"},"await")," and returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," until some async logic is resolved.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1166"},"core/src/lib/Types.ts:1166"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-cookie-object"},(0,r.yg)("a",{id:"cookie",name:"cookie"})," ",(0,r.yg)("strong",{parentName:"h3"},"Cookie"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"A single cookie entry in a Cookies list.\nThe ",(0,r.yg)("inlineCode",{parentName:"p"},"name")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"value")," field is mandatory.\nIt is better to also specify the ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field, otherwise MemLab\nwill try to infer ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," automatically.\nThe other fields are optional.\nFor concrete use case, please check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#cookies"},"cookies"),"."),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"domain?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"Add when possible: Defines the domain associated with the cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"expires?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"number"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Indicates when the cookie will expire, in Unix time (seconds)")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"httpOnly?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"boolean"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Flag to determine if the cookie is accessible only over HTTP")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"name")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"Mandatory: Represents the name of the cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"path?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"string"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Defines the domain associated with the cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"sameSite?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},'"Strict"')," ","|"," ",(0,r.yg)("inlineCode",{parentName:"td"},'"Lax"'),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Determines if a cookie is transmitted with cross-site requests, offering a degree of defense against cross-site request forgery attacks.")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"secure?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"boolean"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Flag to indicate if the cookie transmission requires a secure protocol (e.g., HTTPS)")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"session?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"boolean"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Flag to check if the cookie is a session cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"url?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"string"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Specifies the request-URI linked with the cookie setup. This can influence the cookie's default domain and path")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"value")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"Mandatory: Represents the value assigned to the cookie")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L236"},"core/src/lib/Types.ts:236"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-cookies-cookie"},(0,r.yg)("a",{id:"cookies",name:"cookies"})," ",(0,r.yg)("strong",{parentName:"h3"},"Cookies"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#cookie"},(0,r.yg)("inlineCode",{parentName:"a"},"Cookie")),"[]"),(0,r.yg)("p",null,"Data structure for holding cookies.\nFor concrete use case, please check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#cookies"},"cookies"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L226"},"core/src/lib/Types.ts:226"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-edgeiterationcallback-edge-iheapedge--optional-stop-boolean----void"},(0,r.yg)("a",{id:"edgeiterationcallback",name:"edgeiterationcallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"EdgeIterationCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"edge"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),") => ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#optional"},(0,r.yg)("inlineCode",{parentName:"a"},"Optional")),"<{ ",(0,r.yg)("inlineCode",{parentName:"h3"},"stop"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")," }",">"," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"void")),(0,r.yg)("p",null,"Executes a provided callback once for JavaScript references.\nFor concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#foreachreference"},"forEachReference"),"\nor ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#foreachreferrer"},"forEachReferrer"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"edge"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#optional"},(0,r.yg)("inlineCode",{parentName:"a"},"Optional")),"<{ ",(0,r.yg)("inlineCode",{parentName:"p"},"stop"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," }",">"," ","|"," ",(0,r.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1795"},"core/src/lib/Types.ts:1795"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-initleakfiltercallback-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--void"},(0,r.yg)("a",{id:"initleakfiltercallback",name:"initleakfiltercallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"InitLeakFilterCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"HeapNodeIdSet"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"void")),(0,r.yg)("p",null,"Lifecycle function callback that is invoked initially once before calling any\nleak filter function.\nFor concrete example, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#beforeleakfilter"},"beforeLeakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))," | heap snapshot see ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"HeapNodeIdSet")," | the set of leaked object (node) ids."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"void"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L554"},"core/src/lib/Types.ts:554"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-interactionscallback-page-page-args-operationargs--promisevoid"},(0,r.yg)("a",{id:"interactionscallback",name:"interactionscallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"InteractionsCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"page"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"args?"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"OperationArgs"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"void"),">"),(0,r.yg)("p",null,"The callback defines browser interactions which are\nused by memlab to interact with the web app under test.\nFor concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#action"},"action")," or ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#back"},"back"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page"))," | the puppeteer ",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page"))," object, which provides APIs to interact with the web browser. To import this type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"args?"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"OperationArgs")))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"p"},"void"),">"," | no return value")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L640"},"core/src/lib/Types.ts:640"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-leakfiltercallback-node-iheapnode-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--boolean"},(0,r.yg)("a",{id:"leakfiltercallback",name:"leakfiltercallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"LeakFilterCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"node"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"HeapNodeIdSet"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,r.yg)("p",null,"Callback that can be used to define a logic to filter the\nleaked objects. The callback is only called for every node\nallocated but not released from the target interaction\nin the heap snapshot."),(0,r.yg)("p",null,"For concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#leakfilter"},"leakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode"))," | the node that is kept alive in the memory in the heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))," | the snapshot of target interaction"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"HeapNodeIdSet")," | the set of leaked node ids"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | the value indicating whether the given node in the snapshot\nshould be considered as leaked."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// any node in the heap snapshot that is greater than 1MB\nfunction leakFilter(node, _snapshot, _leakedNodeIds) {\n return node.retainedSize > 1000000;\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L581"},"core/src/lib/Types.ts:581"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-nullablet-t--null"},(0,r.yg)("a",{id:"nullable",name:"nullable"})," ",(0,r.yg)("strong",{parentName:"h3"},"Nullable"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"null")),(0,r.yg)("p",null,"Given any type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", return the union type ",(0,r.yg)("inlineCode",{parentName:"p"},"T")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"null")),(0,r.yg)("h4",{id:"type-parameters"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"The type that will be made nullable.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L32"},"core/src/lib/Types.ts:32"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optionalt-t--null--undefined"},(0,r.yg)("a",{id:"optional",name:"optional"})," ",(0,r.yg)("strong",{parentName:"h3"},"Optional"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"null")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"undefined")),(0,r.yg)("p",null,"Given any type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", return the union type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"null"),", and ",(0,r.yg)("inlineCode",{parentName:"p"},"undefined"),"."),(0,r.yg)("h4",{id:"type-parameters-1"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"The type that will be made both nullable and undefinable.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L38"},"core/src/lib/Types.ts:38"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-page-puppeteerpage"},(0,r.yg)("a",{id:"page",name:"page"})," ",(0,r.yg)("strong",{parentName:"h3"},"Page"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"PuppeteerPage")),(0,r.yg)("p",null,"This is the puppeteer ",(0,r.yg)("a",{parentName:"p",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nclass used by MemLab. The puppeteer ",(0,r.yg)("inlineCode",{parentName:"p"},"Page")," class instance provides\nAPIs to interact with the web browser."),(0,r.yg)("p",null,"The puppeteer ",(0,r.yg)("inlineCode",{parentName:"p"},"Page")," type can be incompatible across different versions.\nYour local npm-installed puppeteer version may be different from\nthe puppeteer used by MemLab. This may cause some type errors, for example:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {Page} from 'puppeteer';\nimport type {RunOptions} from '@memlab/api';\n\nconst runOptions: RunOptions = {\n scenario: {\n // initial page load url: Google Maps\n url: () => {\n return \"https://www.google.com/maps/@37.386427,-122.0428214,11z\";\n },\n // type error here if your local puppeeter version is different\n // from the puppeteer used by MemLab\n action: async function (page: Page) {\n await page.click('button[aria-label=\"Hotels\"]');\n },\n },\n};\n")),(0,r.yg)("p",null,"To avoid the type error in the code example above, MemLab exports the\npuppeteer ",(0,r.yg)("inlineCode",{parentName:"p"},"Page")," type used by MemLab so that your code can import it\nwhen necessary:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {Page} from '@memlab/core' // import Page type from memlab\nimport type {RunOptions} from 'memlab';\n\nconst runOptions: RunOptions = {\n scenario: {\n // initial page load url: Google Maps\n url: () => {\n return \"https://www.google.com/maps/@37.386427,-122.0428214,11z\";\n },\n // no type error here\n action: async function (page: Page) {\n await page.click('button[aria-label=\"Hotels\"]');\n },\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L207"},"core/src/lib/Types.ts:207"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-predicatort-entity-t--boolean"},(0,r.yg)("a",{id:"predicator",name:"predicator"})," ",(0,r.yg)("strong",{parentName:"h3"},"Predicator"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": (",(0,r.yg)("inlineCode",{parentName:"h3"},"entity"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,r.yg)("h4",{id:"type-parameters-2"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"the type of the entity to be checked")))),(0,r.yg)("p",null,"the predicate callback is used to decide if a\nentity of type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),".\nFor more concrete examples on where it is used,\ncheck out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#findanyreference"},"findAnyReference"),", ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#findanyreferrer"},"findAnyReferrer"),",\nand ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#findreferrers"},"findReferrers"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"entity"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"T")," | the entity to be checked"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," | whether the entity passes the predicate check")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L220"},"core/src/lib/Types.ts:220"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-referencefiltercallback-edge-iheapedge-snapshot-iheapsnapshot-isreferenceusedbydefault-boolean--boolean"},(0,r.yg)("a",{id:"referencefiltercallback",name:"referencefiltercallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"ReferenceFilterCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"edge"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"isReferenceUsedByDefault"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,r.yg)("p",null,"Callback that can be used to define a logic to decide whether\na reference should be filtered (included) for some\ncalculations (e.g., retainer trace calculation)"),(0,r.yg)("p",null,"For concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#leakfilter"},"leakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"edge"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))," | the reference (edge) that is considered for calcualting the retainer trace"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))," | the final snapshot taken after all browser interactions are done."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"isReferenceUsedByDefault"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | MemLab has its own default logic for whether a reference should be filtered (included), if this parameter is true, it means MemLab will consider this reference for inclusion"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | the value indicating whether the given reference should be\nfiltered (i.e., included)")),(0,r.yg)("p",null,"Please also be aware that some edges like self-referencing edges,\nJS engine's internal edges, and hidden edges should not be considered\nas part of the retainer trace. These edges could make the retainer trace\nunncessarily complex and cause confusion. ",(0,r.yg)("inlineCode",{parentName:"p"},"isReferenceUsedByDefault")," will\nbe ",(0,r.yg)("inlineCode",{parentName:"p"},"false")," for these types of edges."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// exclude react fiber references\nfunction retainerReferenceFilter(edge, _snapshot, _isReferenceUsedByDefault) {\n if (edge.name_or_index.toString().startsWith('__reactFiber$')) {\n return false;\n }\n // exclude other references here\n // ...\n return true;\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L624"},"core/src/lib/Types.ts:624"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-runmetainfo-object"},(0,r.yg)("a",{id:"runmetainfo",name:"runmetainfo"})," ",(0,r.yg)("strong",{parentName:"h3"},"RunMetaInfo"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"This data structure holds the information about memlab run.\nYou can retrieve the instance of this type through ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader#getrunmetainfo"},"getRunMetaInfo"),"."),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"browserInfo")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"},(0,r.yg)("inlineCode",{parentName:"a"},"IBrowserInfo"))),(0,r.yg)("td",{parentName:"tr",align:"left"},"input configuration for the browser and output data from the browser")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"type")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"type of the memlab run")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1247"},"core/src/lib/Types.ts:1247"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-undefinablet-t--undefined"},(0,r.yg)("a",{id:"undefinable",name:"undefinable"})," ",(0,r.yg)("strong",{parentName:"h3"},"Undefinable"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"undefined")),(0,r.yg)("p",null,"Given any type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", return the union type ",(0,r.yg)("inlineCode",{parentName:"p"},"T")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"undefined"),"."),(0,r.yg)("h4",{id:"type-parameters-3"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"The type that will be made undefinable.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L44"},"core/src/lib/Types.ts:44"))))),(0,r.yg)("h2",{id:"functions"},"Functions"),(0,r.yg)("h3",{id:"dumpnodeheapsnapshot"},(0,r.yg)("a",{id:"dumpnodeheapsnapshot"}),(0,r.yg)("strong",{parentName:"h3"},"dumpNodeHeapSnapshot"),"()"),(0,r.yg)("p",null,"Take a heap snapshot of the current program state and save it as a\n",(0,r.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," file under a randomly generated folder inside the system's\ntemp folder."),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Note"),": All ",(0,r.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," files could also be loaded by Chrome DevTools."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"string")," | the absolute file path to the saved ",(0,r.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," file.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/NodeHeap.ts#L84"},"core/src/lib/NodeHeap.ts:84"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"tagobjectto-tag"},(0,r.yg)("a",{id:"tagobject"}),(0,r.yg)("strong",{parentName:"h3"},"tagObject"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">","(",(0,r.yg)("inlineCode",{parentName:"h3"},"o"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"tag"),")"),(0,r.yg)("p",null,"Tags a string marker to an object instance, which can later be checked by\n",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot#hasobjectwithtag"},"hasObjectWithTag"),". This API does not modify the object instance in\nany way (e.g., no additional or hidden properties added to the tagged\nobject)."),(0,r.yg)("h4",{id:"type-parameters-4"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"extends ",(0,r.yg)("inlineCode",{parentName:"td"},"object"))))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"o"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"T")," | specify the object instance you want to tag, you cannot tag a ",(0,r.yg)("a",{parentName:"li",href:"https://developer.mozilla.org/en-US/docs/Glossary/Primitive"},"primitive"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"tag"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | marker name to tag on the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"T")," | returns the tagged object instance (same reference as\nthe input argument ",(0,r.yg)("inlineCode",{parentName:"li"},"o"),")"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, AnyValue} from '@memlab/core';\nimport {config, takeNodeMinimalHeap, tagObject} from '@memlab/core';\n\ntest('memory test', async () => {\n config.muteConsole = true;\n const o1: AnyValue = {};\n let o2: AnyValue = {};\n\n // tag o1 with marker: \"memlab-mark-1\", does not modify o1 in any way\n tagObject(o1, 'memlab-mark-1');\n // tag o2 with marker: \"memlab-mark-2\", does not modify o2 in any way\n tagObject(o2, 'memlab-mark-2');\n\n o2 = null;\n\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n // expect object with marker \"memlab-mark-1\" exists\n expect(heap.hasObjectWithTag('memlab-mark-1')).toBe(true);\n\n // expect object with marker \"memlab-mark-2\" can be GCed\n expect(heap.hasObjectWithTag('memlab-mark-2')).toBe(false);\n\n}, 30000);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/NodeHeap.ts#L59"},"core/src/lib/NodeHeap.ts:59"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"takenodeminimalheap"},(0,r.yg)("a",{id:"takenodeminimalheap"}),(0,r.yg)("strong",{parentName:"h3"},"takeNodeMinimalHeap"),"()"),(0,r.yg)("p",null,"Take a heap snapshot of the current program state\nand parse it as ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"),". Notice that\nthis API does not calculate some heap analysis meta data\nfor heap analysis. But this also means faster heap parsing."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),">"," | heap representation without heap analysis meta data.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples:")))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {takeNodeMinimalHeap} from '@memlab/core';\n\n(async function () {\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n})();\n")),(0,r.yg)("p",null,"If you need to get the heap snapshot with heap analysis meta data, please\nuse ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/NodeHeap.ts#L152"},"core/src/lib/NodeHeap.ts:152"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[6571],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>y});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=t.createContext({}),g=function(e){var a=t.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},s=function(e){var a=g(e.components);return t.createElement(p.Provider,{value:a},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},d=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,l=e.originalType,p=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),m=g(n),d=r,y=m["".concat(p,".").concat(d)]||m[d]||c[d]||l;return n?t.createElement(y,i(i({ref:a},s),{},{components:n})):t.createElement(y,i({ref:a},s))}));function y(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=d;var o={};for(var p in a)hasOwnProperty.call(a,p)&&(o[p]=a[p]);o.originalType=e,o[m]="string"==typeof e?e:r,i[1]=o;for(var g=2;g{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>i,default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>g});var t=n(8168),r=(n(6540),n(5680));const l={id:"core_src",title:"Package: @memlab/core",sidebar_label:"core/src",sidebar_position:0,custom_edit_url:null},i=void 0,o={unversionedId:"api/modules/core_src",id:"api/modules/core_src",title:"Package: @memlab/core",description:"Interfaces",source:"@site/docs/api/modules/core_src.md",sourceDirName:"api/modules",slug:"/api/modules/core_src",permalink:"/memlab/docs/api/modules/core_src",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"core_src",title:"Package: @memlab/core",sidebar_label:"core/src",sidebar_position:0,custom_edit_url:null},sidebar:"sidebar",previous:{title:"api/src",permalink:"/memlab/docs/api/modules/api_src"},next:{title:"heap-analysis/src",permalink:"/memlab/docs/api/modules/heap_analysis_src"}},p={},g=[{value:"Interfaces",id:"interfaces",level:2},{value:"Type Aliases",id:"type-aliases",level:2},{value:' CheckPageLoadCallback: (page: Page) => Promise<boolean>',id:"-checkpageloadcallback-page-page--promiseboolean",level:3},{value:' Cookie: Object',id:"-cookie-object",level:3},{value:' Cookies: Cookie[]',id:"-cookies-cookie",level:3},{value:' EdgeIterationCallback: (edge: IHeapEdge) => Optional<{ stop: boolean }> | void',id:"-edgeiterationcallback-edge-iheapedge--optional-stop-boolean----void",level:3},{value:' InitLeakFilterCallback: (snapshot: IHeapSnapshot, leakedNodeIds: HeapNodeIdSet) => void',id:"-initleakfiltercallback-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--void",level:3},{value:' InteractionsCallback: (page: Page, args?: OperationArgs) => Promise<void>',id:"-interactionscallback-page-page-args-operationargs--promisevoid",level:3},{value:' LeakFilterCallback: (node: IHeapNode, snapshot: IHeapSnapshot, leakedNodeIds: HeapNodeIdSet) => boolean',id:"-leakfiltercallback-node-iheapnode-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--boolean",level:3},{value:' Nullable<T>: T | null',id:"-nullablet-t--null",level:3},{value:"Type parameters",id:"type-parameters",level:4},{value:' Optional<T>: T | null | undefined',id:"-optionalt-t--null--undefined",level:3},{value:"Type parameters",id:"type-parameters-1",level:4},{value:' Page: PuppeteerPage',id:"-page-puppeteerpage",level:3},{value:' Predicator<T>: (entity: T) => boolean',id:"-predicatort-entity-t--boolean",level:3},{value:"Type parameters",id:"type-parameters-2",level:4},{value:' ReferenceFilterCallback: (edge: IHeapEdge, snapshot: IHeapSnapshot, isReferenceUsedByDefault: boolean) => boolean',id:"-referencefiltercallback-edge-iheapedge-snapshot-iheapsnapshot-isreferenceusedbydefault-boolean--boolean",level:3},{value:' RunMetaInfo: Object',id:"-runmetainfo-object",level:3},{value:' Undefinable<T>: T | undefined',id:"-undefinablet-t--undefined",level:3},{value:"Type parameters",id:"type-parameters-3",level:4},{value:"Functions",id:"functions",level:2},{value:'dumpNodeHeapSnapshot()',id:"dumpnodeheapsnapshot",level:3},{value:'tagObject<T>(o, tag)',id:"tagobjectto-tag",level:3},{value:"Type parameters",id:"type-parameters-4",level:4},{value:'takeNodeMinimalHeap()',id:"takenodeminimalheap",level:3}],s={toc:g},m="wrapper";function c(e){let{components:a,...n}=e;return(0,r.yg)(m,(0,t.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("h2",{id:"interfaces"},"Interfaces"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"},"IBrowserInfo")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdges"},"IHeapEdges")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},"IHeapLocation")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNodes"},"IHeapNodes")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter"},"ILeakFilter")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IScenario"},"IScenario"))),(0,r.yg)("h2",{id:"type-aliases"},"Type Aliases"),(0,r.yg)("h3",{id:"-checkpageloadcallback-page-page--promiseboolean"},(0,r.yg)("a",{id:"checkpageloadcallback",name:"checkpageloadcallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"CheckPageLoadCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"page"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean"),">"),(0,r.yg)("p",null,"Callback function to provide if the page is loaded.\nFor concrete example, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#ispageloaded"},"isPageLoaded"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page"))," | puppeteer's ",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page/"},"Page")," object. To import this type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"p"},"boolean"),">"," | a boolean value, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),", memlab will consider\nthe navigation completes, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"false"),", memlab will keep calling\nthis callback until it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),". This is an async callback, you can\nalso ",(0,r.yg)("inlineCode",{parentName:"p"},"await")," and returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," until some async logic is resolved.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1166"},"core/src/lib/Types.ts:1166"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-cookie-object"},(0,r.yg)("a",{id:"cookie",name:"cookie"})," ",(0,r.yg)("strong",{parentName:"h3"},"Cookie"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"A single cookie entry in a Cookies list.\nThe ",(0,r.yg)("inlineCode",{parentName:"p"},"name")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"value")," field is mandatory.\nIt is better to also specify the ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field, otherwise MemLab\nwill try to infer ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," automatically.\nThe other fields are optional.\nFor concrete use case, please check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#cookies"},"cookies"),"."),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"domain?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"Add when possible: Defines the domain associated with the cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"expires?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"number"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Indicates when the cookie will expire, in Unix time (seconds)")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"httpOnly?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"boolean"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Flag to determine if the cookie is accessible only over HTTP")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"name")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"Mandatory: Represents the name of the cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"path?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"string"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Defines the domain associated with the cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"sameSite?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},'"Strict"')," ","|"," ",(0,r.yg)("inlineCode",{parentName:"td"},'"Lax"'),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Determines if a cookie is transmitted with cross-site requests, offering a degree of defense against cross-site request forgery attacks.")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"secure?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"boolean"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Flag to indicate if the cookie transmission requires a secure protocol (e.g., HTTPS)")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"session?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"boolean"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Flag to check if the cookie is a session cookie")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"url?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/modules/core_src#undefinable"},(0,r.yg)("inlineCode",{parentName:"a"},"Undefinable")),"<",(0,r.yg)("inlineCode",{parentName:"td"},"string"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"Optional: Specifies the request-URI linked with the cookie setup. This can influence the cookie's default domain and path")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"value")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"Mandatory: Represents the value assigned to the cookie")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L236"},"core/src/lib/Types.ts:236"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-cookies-cookie"},(0,r.yg)("a",{id:"cookies",name:"cookies"})," ",(0,r.yg)("strong",{parentName:"h3"},"Cookies"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#cookie"},(0,r.yg)("inlineCode",{parentName:"a"},"Cookie")),"[]"),(0,r.yg)("p",null,"Data structure for holding cookies.\nFor concrete use case, please check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#cookies"},"cookies"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L226"},"core/src/lib/Types.ts:226"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-edgeiterationcallback-edge-iheapedge--optional-stop-boolean----void"},(0,r.yg)("a",{id:"edgeiterationcallback",name:"edgeiterationcallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"EdgeIterationCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"edge"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),") => ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#optional"},(0,r.yg)("inlineCode",{parentName:"a"},"Optional")),"<{ ",(0,r.yg)("inlineCode",{parentName:"h3"},"stop"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")," }",">"," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"void")),(0,r.yg)("p",null,"Executes a provided callback once for JavaScript references.\nFor concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#foreachreference"},"forEachReference"),"\nor ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#foreachreferrer"},"forEachReferrer"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"edge"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#optional"},(0,r.yg)("inlineCode",{parentName:"a"},"Optional")),"<{ ",(0,r.yg)("inlineCode",{parentName:"p"},"stop"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," }",">"," ","|"," ",(0,r.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1795"},"core/src/lib/Types.ts:1795"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-initleakfiltercallback-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--void"},(0,r.yg)("a",{id:"initleakfiltercallback",name:"initleakfiltercallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"InitLeakFilterCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"HeapNodeIdSet"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"void")),(0,r.yg)("p",null,"Lifecycle function callback that is invoked initially once before calling any\nleak filter function.\nFor concrete example, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#beforeleakfilter"},"beforeLeakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))," | heap snapshot see ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"HeapNodeIdSet")," | the set of leaked object (node) ids."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"void"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L554"},"core/src/lib/Types.ts:554"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-interactionscallback-page-page-args-operationargs--promisevoid"},(0,r.yg)("a",{id:"interactionscallback",name:"interactionscallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"InteractionsCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"page"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"args?"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"OperationArgs"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"void"),">"),(0,r.yg)("p",null,"The callback defines browser interactions which are\nused by memlab to interact with the web app under test.\nFor concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#action"},"action")," or ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#back"},"back"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page"))," | the puppeteer ",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page"))," object, which provides APIs to interact with the web browser. To import this type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"args?"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"OperationArgs")))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"p"},"void"),">"," | no return value")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L640"},"core/src/lib/Types.ts:640"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-leakfiltercallback-node-iheapnode-snapshot-iheapsnapshot-leakednodeids-heapnodeidset--boolean"},(0,r.yg)("a",{id:"leakfiltercallback",name:"leakfiltercallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"LeakFilterCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"node"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"HeapNodeIdSet"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,r.yg)("p",null,"Callback that can be used to define a logic to filter the\nleaked objects. The callback is only called for every node\nallocated but not released from the target interaction\nin the heap snapshot."),(0,r.yg)("p",null,"For concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#leakfilter"},"leakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode"))," | the node that is kept alive in the memory in the heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))," | the snapshot of target interaction"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"HeapNodeIdSet")," | the set of leaked node ids"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | the value indicating whether the given node in the snapshot\nshould be considered as leaked."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// any node in the heap snapshot that is greater than 1MB\nfunction leakFilter(node, _snapshot, _leakedNodeIds) {\n return node.retainedSize > 1000000;\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L581"},"core/src/lib/Types.ts:581"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-nullablet-t--null"},(0,r.yg)("a",{id:"nullable",name:"nullable"})," ",(0,r.yg)("strong",{parentName:"h3"},"Nullable"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"null")),(0,r.yg)("p",null,"Given any type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", return the union type ",(0,r.yg)("inlineCode",{parentName:"p"},"T")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"null")),(0,r.yg)("h4",{id:"type-parameters"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"The type that will be made nullable.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L32"},"core/src/lib/Types.ts:32"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optionalt-t--null--undefined"},(0,r.yg)("a",{id:"optional",name:"optional"})," ",(0,r.yg)("strong",{parentName:"h3"},"Optional"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"null")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"undefined")),(0,r.yg)("p",null,"Given any type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", return the union type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"null"),", and ",(0,r.yg)("inlineCode",{parentName:"p"},"undefined"),"."),(0,r.yg)("h4",{id:"type-parameters-1"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"The type that will be made both nullable and undefinable.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L38"},"core/src/lib/Types.ts:38"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-page-puppeteerpage"},(0,r.yg)("a",{id:"page",name:"page"})," ",(0,r.yg)("strong",{parentName:"h3"},"Page"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"PuppeteerPage")),(0,r.yg)("p",null,"This is the puppeteer ",(0,r.yg)("a",{parentName:"p",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nclass used by MemLab. The puppeteer ",(0,r.yg)("inlineCode",{parentName:"p"},"Page")," class instance provides\nAPIs to interact with the web browser."),(0,r.yg)("p",null,"The puppeteer ",(0,r.yg)("inlineCode",{parentName:"p"},"Page")," type can be incompatible across different versions.\nYour local npm-installed puppeteer version may be different from\nthe puppeteer used by MemLab. This may cause some type errors, for example:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {Page} from 'puppeteer';\nimport type {RunOptions} from '@memlab/api';\n\nconst runOptions: RunOptions = {\n scenario: {\n // initial page load url: Google Maps\n url: () => {\n return \"https://www.google.com/maps/@37.386427,-122.0428214,11z\";\n },\n // type error here if your local puppeeter version is different\n // from the puppeteer used by MemLab\n action: async function (page: Page) {\n await page.click('button[aria-label=\"Hotels\"]');\n },\n },\n};\n")),(0,r.yg)("p",null,"To avoid the type error in the code example above, MemLab exports the\npuppeteer ",(0,r.yg)("inlineCode",{parentName:"p"},"Page")," type used by MemLab so that your code can import it\nwhen necessary:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {Page} from '@memlab/core' // import Page type from memlab\nimport type {RunOptions} from 'memlab';\n\nconst runOptions: RunOptions = {\n scenario: {\n // initial page load url: Google Maps\n url: () => {\n return \"https://www.google.com/maps/@37.386427,-122.0428214,11z\";\n },\n // no type error here\n action: async function (page: Page) {\n await page.click('button[aria-label=\"Hotels\"]');\n },\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L207"},"core/src/lib/Types.ts:207"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-predicatort-entity-t--boolean"},(0,r.yg)("a",{id:"predicator",name:"predicator"})," ",(0,r.yg)("strong",{parentName:"h3"},"Predicator"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": (",(0,r.yg)("inlineCode",{parentName:"h3"},"entity"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,r.yg)("h4",{id:"type-parameters-2"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"the type of the entity to be checked")))),(0,r.yg)("p",null,"the predicate callback is used to decide if a\nentity of type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),".\nFor more concrete examples on where it is used,\ncheck out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#findanyreference"},"findAnyReference"),", ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#findanyreferrer"},"findAnyReferrer"),",\nand ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode#findreferrers"},"findReferrers"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"entity"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"T")," | the entity to be checked"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," | whether the entity passes the predicate check")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L220"},"core/src/lib/Types.ts:220"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-referencefiltercallback-edge-iheapedge-snapshot-iheapsnapshot-isreferenceusedbydefault-boolean--boolean"},(0,r.yg)("a",{id:"referencefiltercallback",name:"referencefiltercallback"})," ",(0,r.yg)("strong",{parentName:"h3"},"ReferenceFilterCallback"),": (",(0,r.yg)("inlineCode",{parentName:"h3"},"edge"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"isReferenceUsedByDefault"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean"),") => ",(0,r.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,r.yg)("p",null,"Callback that can be used to define a logic to decide whether\na reference should be filtered (included) for some\ncalculations (e.g., retainer trace calculation)"),(0,r.yg)("p",null,"For concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#leakfilter"},"leakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"edge"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))," | the reference (edge) that is considered for calcualting the retainer trace"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))," | the final snapshot taken after all browser interactions are done."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"isReferenceUsedByDefault"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | MemLab has its own default logic for whether a reference should be filtered (included), if this parameter is true, it means MemLab will consider this reference for inclusion"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | the value indicating whether the given reference should be\nfiltered (i.e., included)")),(0,r.yg)("p",null,"Please also be aware that some edges like self-referencing edges,\nJS engine's internal edges, and hidden edges should not be considered\nas part of the retainer trace. These edges could make the retainer trace\nunncessarily complex and cause confusion. ",(0,r.yg)("inlineCode",{parentName:"p"},"isReferenceUsedByDefault")," will\nbe ",(0,r.yg)("inlineCode",{parentName:"p"},"false")," for these types of edges."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// exclude react fiber references\nfunction retainerReferenceFilter(edge, _snapshot, _isReferenceUsedByDefault) {\n if (edge.name_or_index.toString().startsWith('__reactFiber$')) {\n return false;\n }\n // exclude other references here\n // ...\n return true;\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L624"},"core/src/lib/Types.ts:624"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-runmetainfo-object"},(0,r.yg)("a",{id:"runmetainfo",name:"runmetainfo"})," ",(0,r.yg)("strong",{parentName:"h3"},"RunMetaInfo"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"This data structure holds the information about memlab run.\nYou can retrieve the instance of this type through ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader#getrunmetainfo"},"getRunMetaInfo"),"."),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"browserInfo")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"},(0,r.yg)("inlineCode",{parentName:"a"},"IBrowserInfo"))),(0,r.yg)("td",{parentName:"tr",align:"left"},"input configuration for the browser and output data from the browser")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"type")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"type of the memlab run")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1247"},"core/src/lib/Types.ts:1247"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-undefinablet-t--undefined"},(0,r.yg)("a",{id:"undefinable",name:"undefinable"})," ",(0,r.yg)("strong",{parentName:"h3"},"Undefinable"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">",": ",(0,r.yg)("inlineCode",{parentName:"h3"},"T")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"h3"},"undefined")),(0,r.yg)("p",null,"Given any type ",(0,r.yg)("inlineCode",{parentName:"p"},"T"),", return the union type ",(0,r.yg)("inlineCode",{parentName:"p"},"T")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"undefined"),"."),(0,r.yg)("h4",{id:"type-parameters-3"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"The type that will be made undefinable.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L44"},"core/src/lib/Types.ts:44"))))),(0,r.yg)("h2",{id:"functions"},"Functions"),(0,r.yg)("h3",{id:"dumpnodeheapsnapshot"},(0,r.yg)("a",{id:"dumpnodeheapsnapshot"}),(0,r.yg)("strong",{parentName:"h3"},"dumpNodeHeapSnapshot"),"()"),(0,r.yg)("p",null,"Take a heap snapshot of the current program state and save it as a\n",(0,r.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," file under a randomly generated folder inside the system's\ntemp folder."),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Note"),": All ",(0,r.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," files could also be loaded by Chrome DevTools."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"string")," | the absolute file path to the saved ",(0,r.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," file.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/NodeHeap.ts#L84"},"core/src/lib/NodeHeap.ts:84"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"tagobjectto-tag"},(0,r.yg)("a",{id:"tagobject"}),(0,r.yg)("strong",{parentName:"h3"},"tagObject"),"<",(0,r.yg)("inlineCode",{parentName:"h3"},"T"),">","(",(0,r.yg)("inlineCode",{parentName:"h3"},"o"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"tag"),")"),(0,r.yg)("p",null,"Tags a string marker to an object instance, which can later be checked by\n",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot#hasobjectwithtag"},"hasObjectWithTag"),". This API does not modify the object instance in\nany way (e.g., no additional or hidden properties added to the tagged\nobject)."),(0,r.yg)("h4",{id:"type-parameters-4"},"Type parameters"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"T")),(0,r.yg)("td",{parentName:"tr",align:"left"},"extends ",(0,r.yg)("inlineCode",{parentName:"td"},"object"))))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"o"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"T")," | specify the object instance you want to tag, you cannot tag a ",(0,r.yg)("a",{parentName:"li",href:"https://developer.mozilla.org/en-US/docs/Glossary/Primitive"},"primitive"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"tag"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | marker name to tag on the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"T")," | returns the tagged object instance (same reference as\nthe input argument ",(0,r.yg)("inlineCode",{parentName:"li"},"o"),")"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, AnyValue} from '@memlab/core';\nimport {config, takeNodeMinimalHeap, tagObject} from '@memlab/core';\n\ntest('memory test', async () => {\n config.muteConsole = true;\n const o1: AnyValue = {};\n let o2: AnyValue = {};\n\n // tag o1 with marker: \"memlab-mark-1\", does not modify o1 in any way\n tagObject(o1, 'memlab-mark-1');\n // tag o2 with marker: \"memlab-mark-2\", does not modify o2 in any way\n tagObject(o2, 'memlab-mark-2');\n\n o2 = null;\n\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n // expect object with marker \"memlab-mark-1\" exists\n expect(heap.hasObjectWithTag('memlab-mark-1')).toBe(true);\n\n // expect object with marker \"memlab-mark-2\" can be GCed\n expect(heap.hasObjectWithTag('memlab-mark-2')).toBe(false);\n\n}, 30000);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/NodeHeap.ts#L59"},"core/src/lib/NodeHeap.ts:59"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"takenodeminimalheap"},(0,r.yg)("a",{id:"takenodeminimalheap"}),(0,r.yg)("strong",{parentName:"h3"},"takeNodeMinimalHeap"),"()"),(0,r.yg)("p",null,"Take a heap snapshot of the current program state\nand parse it as ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"),". Notice that\nthis API does not calculate some heap analysis meta data\nfor heap analysis. But this also means faster heap parsing."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot")),">"," | heap representation without heap analysis meta data.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples:")))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {takeNodeMinimalHeap} from '@memlab/core';\n\n(async function () {\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n})();\n")),(0,r.yg)("p",null,"If you need to get the heap snapshot with heap analysis meta data, please\nuse ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/NodeHeap.ts#L152"},"core/src/lib/NodeHeap.ts:152"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/27652c34.f127ad7f.js b/assets/js/27652c34.748f0e3d.js similarity index 94% rename from assets/js/27652c34.f127ad7f.js rename to assets/js/27652c34.748f0e3d.js index 31af439dd..c9dfe5e0f 100644 --- a/assets/js/27652c34.f127ad7f.js +++ b/assets/js/27652c34.748f0e3d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8417],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var g=r.createContext({}),p=function(e){var a=r.useContext(g),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},s=function(e){var a=p(e.components);return r.createElement(g.Provider,{value:a},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},m=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,i=e.originalType,g=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),c=p(n),m=t,y=c["".concat(g,".").concat(m)]||c[m]||d[m]||i;return n?r.createElement(y,l(l({ref:a},s),{},{components:n})):r.createElement(y,l({ref:a},s))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var i=n.length,l=new Array(i);l[0]=m;var o={};for(var g in a)hasOwnProperty.call(a,g)&&(o[g]=a[g]);o.originalType=e,o[c]="string"==typeof e?e:t,l[1]=o;for(var p=2;p{n.r(a),n.d(a,{assets:()=>g,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(8168),t=(n(6540),n(5680));const i={id:"core_src.IHeapStringNode",title:"Interface: IHeapStringNode",sidebar_label:"IHeapStringNode",custom_edit_url:null},l=void 0,o={unversionedId:"api/interfaces/core_src.IHeapStringNode",id:"api/interfaces/core_src.IHeapStringNode",title:"Interface: IHeapStringNode",description:"An IHeapStringNode instance represents a JS string in a heap snapshot.",source:"@site/docs/api/interfaces/core_src.IHeapStringNode.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapStringNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapStringNode",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapStringNode",title:"Interface: IHeapStringNode",sidebar_label:"IHeapStringNode",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapSnapshot",permalink:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},next:{title:"ILeakFilter",permalink:"/memlab/docs/api/interfaces/core_src.ILeakFilter"}},g={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Properties",id:"properties",level:2},{value:' dominatorNode: Nullable<IHeapNode>',id:"-dominatornode-nullableiheapnode",level:3},{value:' edge_count: number',id:"-edge_count-number",level:3},{value:' hasPathEdge: boolean',id:"-haspathedge-boolean",level:3},{value:' id: number',id:"-id-number",level:3},{value:' isString: boolean',id:"-isstring-boolean",level:3},{value:' is_detached: boolean',id:"-is_detached-boolean",level:3},{value:' location: Nullable<IHeapLocation>',id:"-location-nullableiheaplocation",level:3},{value:' name: string',id:"-name-string",level:3},{value:' nodeIndex: number',id:"-nodeindex-number",level:3},{value:' numOfReferrers: number',id:"-numofreferrers-number",level:3},{value:' pathEdge: null | IHeapEdge',id:"-pathedge-null--iheapedge",level:3},{value:' references: IHeapEdge[]',id:"-references-iheapedge",level:3},{value:' referrers: IHeapEdge[]',id:"-referrers-iheapedge",level:3},{value:' retainedSize: number',id:"-retainedsize-number",level:3},{value:' self_size: number',id:"-self_size-number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:' stringValue: string',id:"-stringvalue-string",level:3},{value:' type: string',id:"-type-string",level:3},{value:"Methods",id:"methods",level:2},{value:'findAnyReference(predicate)',id:"findanyreferencepredicate",level:3},{value:'findAnyReferrer(predicate)',id:"findanyreferrerpredicate",level:3},{value:'findAnyReferrerNode(predicate)',id:"findanyreferrernodepredicate",level:3},{value:'findReferrerNodes(predicate)',id:"findreferrernodespredicate",level:3},{value:'findReferrers(predicate)',id:"findreferrerspredicate",level:3},{value:'forEachReference(callback)',id:"foreachreferencecallback",level:3},{value:'forEachReferrer(callback)',id:"foreachreferrercallback",level:3},{value:'getAnyReferrer(edgeName, edgeType?)',id:"getanyreferreredgename-edgetype",level:3},{value:'getAnyReferrerNode(edgeName, edgeType?)',id:"getanyreferrernodeedgename-edgetype",level:3},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'getReference(edgeName, edgeType?)',id:"getreferenceedgename-edgetype",level:3},{value:'getReferenceNode(edgeName, edgeType?)',id:"getreferencenodeedgename-edgetype",level:3},{value:'getReferrerNodes(edgeName, edgeType?)',id:"getreferrernodesedgename-edgetype",level:3},{value:'getReferrers(edgeName, edgeType?)',id:"getreferrersedgename-edgetype",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3},{value:'toStringNode()',id:"tostringnode",level:3}],s={toc:p},c="wrapper";function d(e){let{components:a,...n}=e;return(0,t.yg)(c,(0,r.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"An ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapStringNode")," instance represents a JS string in a heap snapshot.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapStringNode")," instance"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode, IHeapStringNode} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each node (heap object)\n heap.nodes.forEach((node: IHeapNode, i: number) => {\n if (node.isString) {\n const stringNode: IheapStringNode = node.toStringNode();\n // get the string value\n stringNode.stringValue;\n }\n });\n})();\n")),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode"))),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"IHeapStringNode"))))),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-dominatornode-nullableiheapnode"},(0,t.yg)("a",{id:"dominatornode",name:"dominatornode"})," ",(0,t.yg)("strong",{parentName:"h3"},"dominatorNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"),(0,t.yg)("p",null,"get the dominator node of this node. If the dominator node gets released\nthere will be no path from GC to this node, and therefore this node can\nalso be released.\nFor more information on what a dominator node is, please check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1904"},"core/src/lib/Types.ts:1904"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-edge_count-number"},(0,t.yg)("a",{id:"edge\\_count",name:"edge\\_count"})," ",(0,t.yg)("strong",{parentName:"h3"},"edge","_","count"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of outgoing JS references (including engine-internal,\nnative, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1858"},"core/src/lib/Types.ts:1858"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-haspathedge-boolean"},(0,t.yg)("a",{id:"haspathedge",name:"haspathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"hasPathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"returns true if the heap node has been set an incoming edge\nwhich leads to the parent node on the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1880"},"core/src/lib/Types.ts:1880"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-id-number"},(0,t.yg)("a",{id:"id",name:"id"})," ",(0,t.yg)("strong",{parentName:"h3"},"id"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"unique id of the heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1785"},"core/src/lib/Types.ts:1785"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-isstring-boolean"},(0,t.yg)("a",{id:"isstring",name:"isstring"})," ",(0,t.yg)("strong",{parentName:"h3"},"isString"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"check if this a string node (normal string node, concatenated string node\nor sliced string node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1916"},"core/src/lib/Types.ts:1916"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-is_detached-boolean"},(0,t.yg)("a",{id:"is\\_detached",name:"is\\_detached"})," ",(0,t.yg)("strong",{parentName:"h3"},"is","_","detached"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a DOM element and the DOM element is detached\nfrom the DOM tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a React Fiber node and the Fiber node is unmounted\nfrom the React Fiber tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";\notherwise it will be ",(0,t.yg)("inlineCode",{parentName:"p"},"false"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1840"},"core/src/lib/Types.ts:1840"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-location-nullableiheaplocation"},(0,t.yg)("a",{id:"location",name:"location"})," ",(0,t.yg)("strong",{parentName:"h3"},"location"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapLocation")),">"),(0,t.yg)("p",null,"source location information of this heap object (if it is recorded by\nthe heap snapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1909"},"core/src/lib/Types.ts:1909"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-name-string"},(0,t.yg)("a",{id:"name",name:"name"})," ",(0,t.yg)("strong",{parentName:"h3"},"name"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"this is the ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," field associated with the heap object,\nfor JS object instances (type ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),"), ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the constructor's name\nof the object instance. for ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the string value."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1781"},"core/src/lib/Types.ts:1781"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-nodeindex-number"},(0,t.yg)("a",{id:"nodeindex",name:"nodeindex"})," ",(0,t.yg)("strong",{parentName:"h3"},"nodeIndex"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"index of this heap object inside the ",(0,t.yg)("inlineCode",{parentName:"p"},"node.snapshot.nodes")," pseudo array"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1889"},"core/src/lib/Types.ts:1889"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-numofreferrers-number"},(0,t.yg)("a",{id:"numofreferrers",name:"numofreferrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"numOfReferrers"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"Get the number of all incoming references pointing to this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1875"},"core/src/lib/Types.ts:1875"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-pathedge-null--iheapedge"},(0,t.yg)("a",{id:"pathedge",name:"pathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"pathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"null")," ","|"," ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))),(0,t.yg)("p",null,"The incoming edge which leads to the parent node\non the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1885"},"core/src/lib/Types.ts:1885"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-references-iheapedge"},(0,t.yg)("a",{id:"references",name:"references"})," ",(0,t.yg)("strong",{parentName:"h3"},"references"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all outgoing JS references from this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1865"},"core/src/lib/Types.ts:1865"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-referrers-iheapedge"},(0,t.yg)("a",{id:"referrers",name:"referrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"referrers"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all incoming JS references pointing to this heap\nobject (including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1870"},"core/src/lib/Types.ts:1870"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-retainedsize-number"},(0,t.yg)("a",{id:"retainedsize",name:"retainedsize"})," ",(0,t.yg)("strong",{parentName:"h3"},"retainedSize"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"retained size")," of the heap object (i.e., the total size of memory that\ncould be released if this object is released). For difference between\n",(0,t.yg)("strong",{parentName:"p"},"retained size")," and ",(0,t.yg)("strong",{parentName:"p"},"shallow size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1896"},"core/src/lib/Types.ts:1896"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-self_size-number"},(0,t.yg)("a",{id:"self\\_size",name:"self\\_size"})," ",(0,t.yg)("strong",{parentName:"h3"},"self","_","size"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"shallow size")," of the heap object (i.e., the size of memory that is held\nby the object itself.). For difference between ",(0,t.yg)("strong",{parentName:"p"},"shallow size")," and\n",(0,t.yg)("strong",{parentName:"p"},"retained size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1853"},"core/src/lib/Types.ts:1853"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,t.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,t.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,t.yg)("p",null,"get the ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1832"},"core/src/lib/Types.ts:1832"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-stringvalue-string"},(0,t.yg)("a",{id:"stringvalue",name:"stringvalue"})," ",(0,t.yg)("strong",{parentName:"h3"},"stringValue"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"get the string value of the JS string heap object associated with\nthis ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapStringNode")," instance in heap"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2226"},"core/src/lib/Types.ts:2226"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-type-string"},(0,t.yg)("a",{id:"type",name:"type"})," ",(0,t.yg)("strong",{parentName:"h3"},"type"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"the type of the heap node object. All possible types:\nThis is engine-specific, for example all types in V8:\n",(0,t.yg)("inlineCode",{parentName:"p"},"hidden"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"array"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"code"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"closure"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"regexp"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"number"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"native"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"synthetic"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"concatenated string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"sliced string"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"symbol"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"bigint")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1775"},"core/src/lib/Types.ts:1775"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"findanyreferencepredicate"},(0,t.yg)("a",{id:"findanyreference"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\nin the hosting node (or outgoing edges from the node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first outgoing edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const reference = node.findAnyReference((edge: IHeapEdge) => {\n // find the outgoing reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1997"},"core/src/lib/Types.ts:1997"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrerpredicate"},(0,t.yg)("a",{id:"findanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node) until the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first incoming edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrer((edge: IHeapEdge) => {\n // find the incoming reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2014"},"core/src/lib/Types.ts:2014"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrernodepredicate"},(0,t.yg)("a",{id:"findanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each incoming JavaScript heap object"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the first referring node for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such node is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrerNode((node: IHeapNode) => {\n // find the referring node with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2032"},"core/src/lib/Types.ts:2032"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrernodespredicate"},(0,t.yg)("a",{id:"findreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each referrer nodes"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing all the referrer nodes for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nnode is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrerNodes = node.findReferrerNodes((node: IHeapNode) => {\n // find all the referring nodes with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2067"},"core/src/lib/Types.ts:2067"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrerspredicate"},(0,t.yg)("a",{id:"findreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nedge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrers = node.findReferrers((edge: IHeapEdge) => {\n // find all the incoming references with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2049"},"core/src/lib/Types.ts:2049"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferencecallback"},(0,t.yg)("a",{id:"foreachreference"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference in the\nhosting node (or outgoing edges from the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReference((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.references list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1962"},"core/src/lib/Types.ts:1962"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferrercallback"},(0,t.yg)("a",{id:"foreachreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference pointing\nto the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReferrer((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.referrers list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1980"},"core/src/lib/Types.ts:1980"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferreredgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the incoming edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS reference named \"ref\" pointing to node\nconst reference = node.getAnyReferrer('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2122"},"core/src/lib/Types.ts:2122"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferrernodeedgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds one of the incoming JS\nreferences pointing to the hosting node, and returns the JS heap object\ncontaining the incoming reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node containing the incoming JS reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst n1 = node.getAnyReferrerNode('ref', 'property');\n// this is equivalent to\nconst n2 = node.getAnyReferrer('ref', 'property')?.fromNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2145"},"core/src/lib/Types.ts:2145"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getjsonifyableobject"},(0,t.yg)("a",{id:"getjsonifyableobject"}),(0,t.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,t.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1931"},"core/src/lib/Types.ts:1931"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferenceedgename-edgetype"},(0,t.yg)("a",{id:"getreference"}),(0,t.yg)("strong",{parentName:"h3"},"getReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an outgoing JS\nreference from the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the outgoing edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the internal reference to node's hidden class\nconst reference = node.getReference('map', 'hidden');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2082"},"core/src/lib/Types.ts:2082"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferencenodeedgename-edgetype"},(0,t.yg)("a",{id:"getreferencenode"}),(0,t.yg)("strong",{parentName:"h3"},"getReferenceNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds the outgoing JS\nreference from the hosting node, and returns the JS heap object pointed to\nby the outgoing JS reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node pointed to by the outgoing reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the node's hidden class\nconst hiddenClassNode = node.getReferenceNode('map', 'hidden');\n// this is equivalent to\nconst hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2104"},"core/src/lib/Types.ts:2104"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrernodesedgename-edgetype"},(0,t.yg)("a",{id:"getreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all of the incoming JS\nreferences pointing to the hosting node, and returns an array containing\nthe hosting node for each of the incoming JS references."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing the hosting nodes, with each node corresponds\nto each incoming JS reference that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst nodes1 = node.getReferrerNodes('ref', 'property');\n// this is equivalent to\nconst nodes2 = node.getReferrers('ref', 'property')\n .map(edge => edge.fromNode);\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2185"},"core/src/lib/Types.ts:2185"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrersedgename-edgetype"},(0,t.yg)("a",{id:"getreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all the incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges that\nmeet the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of of the JS reference named \"ref\" pointing to node\nconst referrers = node.getReferrers('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2164"},"core/src/lib/Types.ts:2164"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tojsonstringargs"},(0,t.yg)("a",{id:"tojsonstring"}),(0,t.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,t.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,t.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"Note: Please be aware that using ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,t.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1944"},"core/src/lib/Types.ts:1944"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tostringnode"},(0,t.yg)("a",{id:"tostringnode"}),(0,t.yg)("strong",{parentName:"h3"},"toStringNode"),"()"),(0,t.yg)("p",null,"convert to an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object if this node is a string node.\nThe ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object supports querying the string content\ninside the string node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapStringNode")),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1922"},"core/src/lib/Types.ts:1922"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8417],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var g=r.createContext({}),p=function(e){var a=r.useContext(g),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},s=function(e){var a=p(e.components);return r.createElement(g.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},d=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,i=e.originalType,g=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),c=p(n),d=t,y=c["".concat(g,".").concat(d)]||c[d]||m[d]||i;return n?r.createElement(y,l(l({ref:a},s),{},{components:n})):r.createElement(y,l({ref:a},s))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var g in a)hasOwnProperty.call(a,g)&&(o[g]=a[g]);o.originalType=e,o[c]="string"==typeof e?e:t,l[1]=o;for(var p=2;p{n.r(a),n.d(a,{assets:()=>g,contentTitle:()=>l,default:()=>m,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var r=n(8168),t=(n(6540),n(5680));const i={id:"core_src.IHeapStringNode",title:"Interface: IHeapStringNode",sidebar_label:"IHeapStringNode",custom_edit_url:null},l=void 0,o={unversionedId:"api/interfaces/core_src.IHeapStringNode",id:"api/interfaces/core_src.IHeapStringNode",title:"Interface: IHeapStringNode",description:"An IHeapStringNode instance represents a JS string in a heap snapshot.",source:"@site/docs/api/interfaces/core_src.IHeapStringNode.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapStringNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapStringNode",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapStringNode",title:"Interface: IHeapStringNode",sidebar_label:"IHeapStringNode",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapSnapshot",permalink:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},next:{title:"ILeakFilter",permalink:"/memlab/docs/api/interfaces/core_src.ILeakFilter"}},g={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Properties",id:"properties",level:2},{value:' dominatorNode: Nullable<IHeapNode>',id:"-dominatornode-nullableiheapnode",level:3},{value:' edge_count: number',id:"-edge_count-number",level:3},{value:' hasPathEdge: boolean',id:"-haspathedge-boolean",level:3},{value:' id: number',id:"-id-number",level:3},{value:' isString: boolean',id:"-isstring-boolean",level:3},{value:' is_detached: boolean',id:"-is_detached-boolean",level:3},{value:' location: Nullable<IHeapLocation>',id:"-location-nullableiheaplocation",level:3},{value:' name: string',id:"-name-string",level:3},{value:' nodeIndex: number',id:"-nodeindex-number",level:3},{value:' numOfReferrers: number',id:"-numofreferrers-number",level:3},{value:' pathEdge: null | IHeapEdge',id:"-pathedge-null--iheapedge",level:3},{value:' references: IHeapEdge[]',id:"-references-iheapedge",level:3},{value:' referrers: IHeapEdge[]',id:"-referrers-iheapedge",level:3},{value:' retainedSize: number',id:"-retainedsize-number",level:3},{value:' self_size: number',id:"-self_size-number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:' stringValue: string',id:"-stringvalue-string",level:3},{value:' type: string',id:"-type-string",level:3},{value:"Methods",id:"methods",level:2},{value:'findAnyReference(predicate)',id:"findanyreferencepredicate",level:3},{value:'findAnyReferrer(predicate)',id:"findanyreferrerpredicate",level:3},{value:'findAnyReferrerNode(predicate)',id:"findanyreferrernodepredicate",level:3},{value:'findReferrerNodes(predicate)',id:"findreferrernodespredicate",level:3},{value:'findReferrers(predicate)',id:"findreferrerspredicate",level:3},{value:'forEachReference(callback)',id:"foreachreferencecallback",level:3},{value:'forEachReferrer(callback)',id:"foreachreferrercallback",level:3},{value:'getAnyReferrer(edgeName, edgeType?)',id:"getanyreferreredgename-edgetype",level:3},{value:'getAnyReferrerNode(edgeName, edgeType?)',id:"getanyreferrernodeedgename-edgetype",level:3},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'getReference(edgeName, edgeType?)',id:"getreferenceedgename-edgetype",level:3},{value:'getReferenceNode(edgeName, edgeType?)',id:"getreferencenodeedgename-edgetype",level:3},{value:'getReferrerNodes(edgeName, edgeType?)',id:"getreferrernodesedgename-edgetype",level:3},{value:'getReferrers(edgeName, edgeType?)',id:"getreferrersedgename-edgetype",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3},{value:'toStringNode()',id:"tostringnode",level:3}],s={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(c,(0,r.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"An ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapStringNode")," instance represents a JS string in a heap snapshot.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapStringNode")," instance"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode, IHeapStringNode} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each node (heap object)\n heap.nodes.forEach((node: IHeapNode, i: number) => {\n if (node.isString) {\n const stringNode: IheapStringNode = node.toStringNode();\n // get the string value\n stringNode.stringValue;\n }\n });\n})();\n")),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode"))),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"IHeapStringNode"))))),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-dominatornode-nullableiheapnode"},(0,t.yg)("a",{id:"dominatornode",name:"dominatornode"})," ",(0,t.yg)("strong",{parentName:"h3"},"dominatorNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"),(0,t.yg)("p",null,"get the dominator node of this node. If the dominator node gets released\nthere will be no path from GC to this node, and therefore this node can\nalso be released.\nFor more information on what a dominator node is, please check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#dominators"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1904"},"core/src/lib/Types.ts:1904"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-edge_count-number"},(0,t.yg)("a",{id:"edge\\_count",name:"edge\\_count"})," ",(0,t.yg)("strong",{parentName:"h3"},"edge","_","count"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of outgoing JS references (including engine-internal,\nnative, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1858"},"core/src/lib/Types.ts:1858"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-haspathedge-boolean"},(0,t.yg)("a",{id:"haspathedge",name:"haspathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"hasPathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"returns true if the heap node has been set an incoming edge\nwhich leads to the parent node on the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1880"},"core/src/lib/Types.ts:1880"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-id-number"},(0,t.yg)("a",{id:"id",name:"id"})," ",(0,t.yg)("strong",{parentName:"h3"},"id"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"unique id of the heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1785"},"core/src/lib/Types.ts:1785"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-isstring-boolean"},(0,t.yg)("a",{id:"isstring",name:"isstring"})," ",(0,t.yg)("strong",{parentName:"h3"},"isString"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"check if this a string node (normal string node, concatenated string node\nor sliced string node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1916"},"core/src/lib/Types.ts:1916"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-is_detached-boolean"},(0,t.yg)("a",{id:"is\\_detached",name:"is\\_detached"})," ",(0,t.yg)("strong",{parentName:"h3"},"is","_","detached"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a DOM element and the DOM element is detached\nfrom the DOM tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"If the heap object is a React Fiber node and the Fiber node is unmounted\nfrom the React Fiber tree, ",(0,t.yg)("inlineCode",{parentName:"p"},"is_detached")," will be ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),";\notherwise it will be ",(0,t.yg)("inlineCode",{parentName:"p"},"false"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1840"},"core/src/lib/Types.ts:1840"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-location-nullableiheaplocation"},(0,t.yg)("a",{id:"location",name:"location"})," ",(0,t.yg)("strong",{parentName:"h3"},"location"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapLocation"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapLocation")),">"),(0,t.yg)("p",null,"source location information of this heap object (if it is recorded by\nthe heap snapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1909"},"core/src/lib/Types.ts:1909"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-name-string"},(0,t.yg)("a",{id:"name",name:"name"})," ",(0,t.yg)("strong",{parentName:"h3"},"name"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"this is the ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," field associated with the heap object,\nfor JS object instances (type ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),"), ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the constructor's name\nof the object instance. for ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"name")," is the string value."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1781"},"core/src/lib/Types.ts:1781"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-nodeindex-number"},(0,t.yg)("a",{id:"nodeindex",name:"nodeindex"})," ",(0,t.yg)("strong",{parentName:"h3"},"nodeIndex"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"index of this heap object inside the ",(0,t.yg)("inlineCode",{parentName:"p"},"node.snapshot.nodes")," pseudo array"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1889"},"core/src/lib/Types.ts:1889"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-numofreferrers-number"},(0,t.yg)("a",{id:"numofreferrers",name:"numofreferrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"numOfReferrers"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"Get the number of all incoming references pointing to this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1875"},"core/src/lib/Types.ts:1875"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-pathedge-null--iheapedge"},(0,t.yg)("a",{id:"pathedge",name:"pathedge"})," ",(0,t.yg)("strong",{parentName:"h3"},"pathEdge"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"null")," ","|"," ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge"))),(0,t.yg)("p",null,"The incoming edge which leads to the parent node\non the shortest path to GC root."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1885"},"core/src/lib/Types.ts:1885"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-references-iheapedge"},(0,t.yg)("a",{id:"references",name:"references"})," ",(0,t.yg)("strong",{parentName:"h3"},"references"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all outgoing JS references from this heap object\n(including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1865"},"core/src/lib/Types.ts:1865"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-referrers-iheapedge"},(0,t.yg)("a",{id:"referrers",name:"referrers"})," ",(0,t.yg)("strong",{parentName:"h3"},"referrers"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[]"),(0,t.yg)("p",null,"Get a JS array containing all incoming JS references pointing to this heap\nobject (including engine-internal, native, and JS references)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1870"},"core/src/lib/Types.ts:1870"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-retainedsize-number"},(0,t.yg)("a",{id:"retainedsize",name:"retainedsize"})," ",(0,t.yg)("strong",{parentName:"h3"},"retainedSize"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"retained size")," of the heap object (i.e., the total size of memory that\ncould be released if this object is released). For difference between\n",(0,t.yg)("strong",{parentName:"p"},"retained size")," and ",(0,t.yg)("strong",{parentName:"p"},"shallow size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1896"},"core/src/lib/Types.ts:1896"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-self_size-number"},(0,t.yg)("a",{id:"self\\_size",name:"self\\_size"})," ",(0,t.yg)("strong",{parentName:"h3"},"self","_","size"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The ",(0,t.yg)("em",{parentName:"p"},"shallow size")," of the heap object (i.e., the size of memory that is held\nby the object itself.). For difference between ",(0,t.yg)("strong",{parentName:"p"},"shallow size")," and\n",(0,t.yg)("strong",{parentName:"p"},"retained size"),", check out\n",(0,t.yg)("a",{parentName:"p",href:"https://developer.chrome.com/docs/devtools/memory-problems/memory-101/#object_sizes"},"this doc"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1853"},"core/src/lib/Types.ts:1853"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,t.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,t.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,t.yg)("p",null,"get the ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this heap object"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1832"},"core/src/lib/Types.ts:1832"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-stringvalue-string"},(0,t.yg)("a",{id:"stringvalue",name:"stringvalue"})," ",(0,t.yg)("strong",{parentName:"h3"},"stringValue"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"get the string value of the JS string heap object associated with\nthis ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapStringNode")," instance in heap"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2226"},"core/src/lib/Types.ts:2226"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-type-string"},(0,t.yg)("a",{id:"type",name:"type"})," ",(0,t.yg)("strong",{parentName:"h3"},"type"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"the type of the heap node object. All possible types:\nThis is engine-specific, for example all types in V8:\n",(0,t.yg)("inlineCode",{parentName:"p"},"hidden"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"array"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"object"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"code"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"closure"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"regexp"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"number"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"native"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"synthetic"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"concatenated string"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"sliced string"),",\n",(0,t.yg)("inlineCode",{parentName:"p"},"symbol"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"bigint")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1775"},"core/src/lib/Types.ts:1775"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"findanyreferencepredicate"},(0,t.yg)("a",{id:"findanyreference"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\nin the hosting node (or outgoing edges from the node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first outgoing edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const reference = node.findAnyReference((edge: IHeapEdge) => {\n // find the outgoing reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1997"},"core/src/lib/Types.ts:1997"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrerpredicate"},(0,t.yg)("a",{id:"findanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node) until the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the first incoming edge for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such edge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrer((edge: IHeapEdge) => {\n // find the incoming reference with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2014"},"core/src/lib/Types.ts:2014"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findanyreferrernodepredicate"},(0,t.yg)("a",{id:"findanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"findAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node) until the predicate\nreturns ",(0,t.yg)("inlineCode",{parentName:"p"},"true")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each incoming JavaScript heap object"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the first referring node for which the predicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),",\notherwise returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null")," if no such node is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrer = node.findAnyReferrerNode((node: IHeapNode) => {\n // find the referring node with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2032"},"core/src/lib/Types.ts:2032"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrernodespredicate"},(0,t.yg)("a",{id:"findreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript heap\nobject (heap graph node) pointing to the hosting node\n(or nodes having edges to the hosting node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the callback for each referrer nodes"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing all the referrer nodes for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nnode is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrerNodes = node.findReferrerNodes((node: IHeapNode) => {\n // find all the referring nodes with name \"Parent\"\n return node.name === 'Parent';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2067"},"core/src/lib/Types.ts:2067"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"findreferrerspredicate"},(0,t.yg)("a",{id:"findreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"findReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"predicate"),")"),(0,t.yg)("p",null,"executes a provided predicate callback once for each JavaScript reference\npointing to the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"predicate"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#predicator"},(0,t.yg)("inlineCode",{parentName:"a"},"Predicator")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges for which the\npredicate returns ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", otherwise returns an empty array if no such\nedge is found.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const referrers = node.findReferrers((edge: IHeapEdge) => {\n // find all the incoming references with name \"ref\"\n return edge.name_or_index === 'ref';\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2049"},"core/src/lib/Types.ts:2049"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferencecallback"},(0,t.yg)("a",{id:"foreachreference"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference in the\nhosting node (or outgoing edges from the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReference((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.references list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1962"},"core/src/lib/Types.ts:1962"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"foreachreferrercallback"},(0,t.yg)("a",{id:"foreachreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"forEachReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"executes a provided callback once for each JavaScript reference pointing\nto the hosting node (or incoming edges to the node)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#edgeiterationcallback"},(0,t.yg)("inlineCode",{parentName:"a"},"EdgeIterationCallback"))," | the callback for each incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"void")," | this API returns void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"node.forEachReferrer((edge: IHeapEdge) => {\n // process edge ...\n\n // if no need to iterate over remaining edges after\n // the current edge in the node.referrers list\n return {stop: true};\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1980"},"core/src/lib/Types.ts:1980"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferreredgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrer"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrer"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the incoming edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS reference named \"ref\" pointing to node\nconst reference = node.getAnyReferrer('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2122"},"core/src/lib/Types.ts:2122"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getanyreferrernodeedgename-edgetype"},(0,t.yg)("a",{id:"getanyreferrernode"}),(0,t.yg)("strong",{parentName:"h3"},"getAnyReferrerNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds one of the incoming JS\nreferences pointing to the hosting node, and returns the JS heap object\ncontaining the incoming reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node containing the incoming JS reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find one of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst n1 = node.getAnyReferrerNode('ref', 'property');\n// this is equivalent to\nconst n2 = node.getAnyReferrer('ref', 'property')?.fromNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2145"},"core/src/lib/Types.ts:2145"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getjsonifyableobject"},(0,t.yg)("a",{id:"getjsonifyableobject"}),(0,t.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,t.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1931"},"core/src/lib/Types.ts:1931"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferenceedgename-edgetype"},(0,t.yg)("a",{id:"getreference"}),(0,t.yg)("strong",{parentName:"h3"},"getReference"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds an outgoing JS\nreference from the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | the outgoing edge that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the internal reference to node's hidden class\nconst reference = node.getReference('map', 'hidden');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2082"},"core/src/lib/Types.ts:2082"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferencenodeedgename-edgetype"},(0,t.yg)("a",{id:"getreferencenode"}),(0,t.yg)("strong",{parentName:"h3"},"getReferenceNode"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds the outgoing JS\nreference from the hosting node, and returns the JS heap object pointed to\nby the outgoing JS reference."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the outgoing JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the outgoing JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the node pointed to by the outgoing reference that meets\nthe specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find the node's hidden class\nconst hiddenClassNode = node.getReferenceNode('map', 'hidden');\n// this is equivalent to\nconst hiddenClassNode2 = node.getReference('map', 'hidden')?.toNode;\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2104"},"core/src/lib/Types.ts:2104"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrernodesedgename-edgetype"},(0,t.yg)("a",{id:"getreferrernodes"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrerNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all of the incoming JS\nreferences pointing to the hosting node, and returns an array containing\nthe hosting node for each of the incoming JS references."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),"[] | an array containing the hosting nodes, with each node corresponds\nto each incoming JS reference that meets the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of the JS heap object with a JS reference\n// named \"ref\" pointing to node\nconst nodes1 = node.getReferrerNodes('ref', 'property');\n// this is equivalent to\nconst nodes2 = node.getReferrers('ref', 'property')\n .map(edge => edge.fromNode);\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2185"},"core/src/lib/Types.ts:2185"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getreferrersedgename-edgetype"},(0,t.yg)("a",{id:"getreferrers"}),(0,t.yg)("strong",{parentName:"h3"},"getReferrers"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeName"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"edgeType?"),")"),(0,t.yg)("p",null,"Given a JS reference's name and type, this API finds all the incoming JS\nreference pointing to the hosting node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeName"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the name of the incoming JavaScript reference"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edgeType?"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | optional parameter specifying the type of the incoming JavaScript reference"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),"[] | an array containing all the incoming edges that\nmeet the specification")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"// find all of of the JS reference named \"ref\" pointing to node\nconst referrers = node.getReferrers('ref', 'property');\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2164"},"core/src/lib/Types.ts:2164"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tojsonstringargs"},(0,t.yg)("a",{id:"tojsonstring"}),(0,t.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,t.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,t.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"Note: Please be aware that using ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,t.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1944"},"core/src/lib/Types.ts:1944"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tostringnode"},(0,t.yg)("a",{id:"tostringnode"}),(0,t.yg)("strong",{parentName:"h3"},"toStringNode"),"()"),(0,t.yg)("p",null,"convert to an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object if this node is a string node.\nThe ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},"IHeapStringNode")," object supports querying the string content\ninside the string node."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapStringNode")),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1922"},"core/src/lib/Types.ts:1922"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2d8affd8.7eefb6b1.js b/assets/js/2d8affd8.3a293416.js similarity index 82% rename from assets/js/2d8affd8.7eefb6b1.js rename to assets/js/2d8affd8.3a293416.js index 6d8749058..3e1aaf265 100644 --- a/assets/js/2d8affd8.7eefb6b1.js +++ b/assets/js/2d8affd8.3a293416.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8032],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>g});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},d=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),c=u(n),d=r,g=c["".concat(s,".").concat(d)]||c[d]||m[d]||o;return n?a.createElement(g,l(l({ref:t},p),{},{components:n})):a.createElement(g,l({ref:t},p))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[c]="string"==typeof e?e:r,l[1]=i;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>u});var a=n(8168),r=(n(6540),n(5680));const o={id:"api_src.ConsoleMode",title:"Enumeration: ConsoleMode",sidebar_label:"ConsoleMode",custom_edit_url:null},l=void 0,i={unversionedId:"api/enums/api_src.ConsoleMode",id:"api/enums/api_src.ConsoleMode",title:"Enumeration: ConsoleMode",description:"enum of all console mode options",source:"@site/docs/api/enums/api_src.ConsoleMode.md",sourceDirName:"api/enums",slug:"/api/enums/api_src.ConsoleMode",permalink:"/memlab/docs/api/enums/api_src.ConsoleMode",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"api_src.ConsoleMode",title:"Enumeration: ConsoleMode",sidebar_label:"ConsoleMode",custom_edit_url:null},sidebar:"sidebar",previous:{title:"heap-analysis/src",permalink:"/memlab/docs/api/modules/heap_analysis_src"},next:{title:"BrowserInteractionResultReader",permalink:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"}},s={},u=[{value:"Enumeration Members",id:"enumeration-members",level:2},{value:' CONTINUOUS_TEST',id:"-continuous_test",level:3},{value:' DEFAULT',id:"-default",level:3},{value:' SILENT',id:"-silent",level:3},{value:' VERBOSE',id:"-verbose",level:3}],p={toc:u},c="wrapper";function m(e){let{components:t,...n}=e;return(0,r.yg)(c,(0,a.A)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"enum of all console mode options"),(0,r.yg)("h2",{id:"enumeration-members"},"Enumeration Members"),(0,r.yg)("h3",{id:"-continuous_test"},(0,r.yg)("a",{id:"continuous\\_test",name:"continuous\\_test"})," ",(0,r.yg)("strong",{parentName:"h3"},"CONTINUOUS","_","TEST")),(0,r.yg)("p",null,"continuous test mode, no terminal output overwrite or animation,\nequivalent to using ",(0,r.yg)("inlineCode",{parentName:"p"},"--sc")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/state/ConsoleModeManager.ts#L26"},"api/src/state/ConsoleModeManager.ts:26"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-default"},(0,r.yg)("a",{id:"default",name:"default"})," ",(0,r.yg)("strong",{parentName:"h3"},"DEFAULT")),(0,r.yg)("p",null,"the default mode, there could be terminal output overwrite and animation,"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/state/ConsoleModeManager.ts#L30"},"api/src/state/ConsoleModeManager.ts:30"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-silent"},(0,r.yg)("a",{id:"silent",name:"silent"})," ",(0,r.yg)("strong",{parentName:"h3"},"SILENT")),(0,r.yg)("p",null,"mute all terminal output, equivalent to using ",(0,r.yg)("inlineCode",{parentName:"p"},"--silent")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/state/ConsoleModeManager.ts#L21"},"api/src/state/ConsoleModeManager.ts:21"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-verbose"},(0,r.yg)("a",{id:"verbose",name:"verbose"})," ",(0,r.yg)("strong",{parentName:"h3"},"VERBOSE")),(0,r.yg)("p",null,"verbose mode, there could be terminal output overwrite and animation"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/state/ConsoleModeManager.ts#L34"},"api/src/state/ConsoleModeManager.ts:34"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8032],{5680:(e,t,n)=>{n.d(t,{xA:()=>p,yg:()=>d});var a=n(6540);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=a.createContext({}),u=function(e){var t=a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=u(e.components);return a.createElement(s.Provider,{value:t},e.children)},m="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},g=a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),m=u(n),g=r,d=m["".concat(s,".").concat(g)]||m[g]||c[g]||o;return n?a.createElement(d,l(l({ref:t},p),{},{components:n})):a.createElement(d,l({ref:t},p))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=g;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i[m]="string"==typeof e?e:r,l[1]=i;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>c,frontMatter:()=>o,metadata:()=>i,toc:()=>u});var a=n(8168),r=(n(6540),n(5680));const o={id:"api_src.ConsoleMode",title:"Enumeration: ConsoleMode",sidebar_label:"ConsoleMode",custom_edit_url:null},l=void 0,i={unversionedId:"api/enums/api_src.ConsoleMode",id:"api/enums/api_src.ConsoleMode",title:"Enumeration: ConsoleMode",description:"enum of all console mode options",source:"@site/docs/api/enums/api_src.ConsoleMode.md",sourceDirName:"api/enums",slug:"/api/enums/api_src.ConsoleMode",permalink:"/memlab/docs/api/enums/api_src.ConsoleMode",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"api_src.ConsoleMode",title:"Enumeration: ConsoleMode",sidebar_label:"ConsoleMode",custom_edit_url:null},sidebar:"sidebar",previous:{title:"heap-analysis/src",permalink:"/memlab/docs/api/modules/heap_analysis_src"},next:{title:"BrowserInteractionResultReader",permalink:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"}},s={},u=[{value:"Enumeration Members",id:"enumeration-members",level:2},{value:' CONTINUOUS_TEST',id:"-continuous_test",level:3},{value:' DEFAULT',id:"-default",level:3},{value:' SILENT',id:"-silent",level:3},{value:' VERBOSE',id:"-verbose",level:3}],p={toc:u},m="wrapper";function c(e){let{components:t,...n}=e;return(0,r.yg)(m,(0,a.A)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"enum of all console mode options"),(0,r.yg)("h2",{id:"enumeration-members"},"Enumeration Members"),(0,r.yg)("h3",{id:"-continuous_test"},(0,r.yg)("a",{id:"continuous\\_test",name:"continuous\\_test"})," ",(0,r.yg)("strong",{parentName:"h3"},"CONTINUOUS","_","TEST")),(0,r.yg)("p",null,"continuous test mode, no terminal output overwrite or animation,\nequivalent to using ",(0,r.yg)("inlineCode",{parentName:"p"},"--sc")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/state/ConsoleModeManager.ts#L26"},"api/src/state/ConsoleModeManager.ts:26"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-default"},(0,r.yg)("a",{id:"default",name:"default"})," ",(0,r.yg)("strong",{parentName:"h3"},"DEFAULT")),(0,r.yg)("p",null,"the default mode, there could be terminal output overwrite and animation,"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/state/ConsoleModeManager.ts#L30"},"api/src/state/ConsoleModeManager.ts:30"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-silent"},(0,r.yg)("a",{id:"silent",name:"silent"})," ",(0,r.yg)("strong",{parentName:"h3"},"SILENT")),(0,r.yg)("p",null,"mute all terminal output, equivalent to using ",(0,r.yg)("inlineCode",{parentName:"p"},"--silent")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/state/ConsoleModeManager.ts#L21"},"api/src/state/ConsoleModeManager.ts:21"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-verbose"},(0,r.yg)("a",{id:"verbose",name:"verbose"})," ",(0,r.yg)("strong",{parentName:"h3"},"VERBOSE")),(0,r.yg)("p",null,"verbose mode, there could be terminal output overwrite and animation"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/state/ConsoleModeManager.ts#L34"},"api/src/state/ConsoleModeManager.ts:34"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2ecac66d.8977e88d.js b/assets/js/2ecac66d.ca2bfef5.js similarity index 97% rename from assets/js/2ecac66d.8977e88d.js rename to assets/js/2ecac66d.ca2bfef5.js index cbc831ffc..a9bf8ea16 100644 --- a/assets/js/2ecac66d.8977e88d.js +++ b/assets/js/2ecac66d.ca2bfef5.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1797],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>u});var t=n(6540);function l(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function s(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(l[n]=e[n]);return l}(e,a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},g=t.forwardRef((function(e,a){var n=e.components,l=e.mdxType,s=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),g=l,u=c["".concat(o,".").concat(g)]||c[g]||m[g]||s;return n?t.createElement(u,i(i({ref:a},y),{},{components:n})):t.createElement(u,i({ref:a},y))}));function u(e,a){var n=arguments,l=a&&a.mdxType;if("string"==typeof e||l){var s=n.length,i=new Array(s);i[0]=g;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:l,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>s,metadata:()=>r,toc:()=>p});var t=n(8168),l=(n(6540),n(5680));const s={id:"heap_analysis_src.DetachedDOMElementAnalysis",title:"Class: DetachedDOMElementAnalysis",sidebar_label:"DetachedDOMElementAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.DetachedDOMElementAnalysis",id:"api/classes/heap_analysis_src.DetachedDOMElementAnalysis",title:"Class: DetachedDOMElementAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.DetachedDOMElementAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.DetachedDOMElementAnalysis",title:"Class: DetachedDOMElementAnalysis",sidebar_label:"DetachedDOMElementAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"CollectionsHoldingStaleAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"},next:{title:"GlobalVariableAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new DetachedDOMElementAnalysis()',id:"new-detacheddomelementanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getDetachedElements()',id:"getdetachedelements",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,l.yg)(c,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,l.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,l.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,l.yg)("p",{parentName:"li"},"\u21b3 ",(0,l.yg)("strong",{parentName:"p"},(0,l.yg)("inlineCode",{parentName:"strong"},"DetachedDOMElementAnalysis"))))),(0,l.yg)("h2",{id:"constructors"},"Constructors"),(0,l.yg)("h3",{id:"new-detacheddomelementanalysis"},(0,l.yg)("a",{id:"new detacheddomelementanalysis"}),(0,l.yg)("strong",{parentName:"h3"},"new DetachedDOMElementAnalysis"),"()"),(0,l.yg)("h2",{id:"methods"},"Methods"),(0,l.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,l.yg)("a",{id:"analyzesnapshotfromfile"}),(0,l.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,l.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,l.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,l.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Parameters"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,l.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,l.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,l.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Example"),":")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,l.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getcommandname"},(0,l.yg)("a",{id:"getcommandname"}),(0,l.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,l.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,l.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,l.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Examples"),":")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts#L21"},"heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts:21"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getdetachedelements"},(0,l.yg)("a",{id:"getdetachedelements"}),(0,l.yg)("strong",{parentName:"h3"},"getDetachedElements"),"()"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"IHeapNode"),"[]"),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts#L48"},"heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts:48"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1797],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>u});var t=n(6540);function l(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function s(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(l[n]=e[n]);return l}(e,a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},g=t.forwardRef((function(e,a){var n=e.components,l=e.mdxType,s=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),g=l,u=c["".concat(o,".").concat(g)]||c[g]||m[g]||s;return n?t.createElement(u,i(i({ref:a},y),{},{components:n})):t.createElement(u,i({ref:a},y))}));function u(e,a){var n=arguments,l=a&&a.mdxType;if("string"==typeof e||l){var s=n.length,i=new Array(s);i[0]=g;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:l,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>s,metadata:()=>r,toc:()=>p});var t=n(8168),l=(n(6540),n(5680));const s={id:"heap_analysis_src.DetachedDOMElementAnalysis",title:"Class: DetachedDOMElementAnalysis",sidebar_label:"DetachedDOMElementAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.DetachedDOMElementAnalysis",id:"api/classes/heap_analysis_src.DetachedDOMElementAnalysis",title:"Class: DetachedDOMElementAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.DetachedDOMElementAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.DetachedDOMElementAnalysis",title:"Class: DetachedDOMElementAnalysis",sidebar_label:"DetachedDOMElementAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"CollectionsHoldingStaleAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"},next:{title:"GlobalVariableAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new DetachedDOMElementAnalysis()',id:"new-detacheddomelementanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getDetachedElements()',id:"getdetachedelements",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,l.yg)(c,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,l.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,l.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,l.yg)("p",{parentName:"li"},"\u21b3 ",(0,l.yg)("strong",{parentName:"p"},(0,l.yg)("inlineCode",{parentName:"strong"},"DetachedDOMElementAnalysis"))))),(0,l.yg)("h2",{id:"constructors"},"Constructors"),(0,l.yg)("h3",{id:"new-detacheddomelementanalysis"},(0,l.yg)("a",{id:"new detacheddomelementanalysis"}),(0,l.yg)("strong",{parentName:"h3"},"new DetachedDOMElementAnalysis"),"()"),(0,l.yg)("h2",{id:"methods"},"Methods"),(0,l.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,l.yg)("a",{id:"analyzesnapshotfromfile"}),(0,l.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,l.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,l.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,l.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Parameters"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,l.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,l.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,l.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Example"),":")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,l.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getcommandname"},(0,l.yg)("a",{id:"getcommandname"}),(0,l.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,l.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,l.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,l.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Examples"),":")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts#L21"},"heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts:21"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getdetachedelements"},(0,l.yg)("a",{id:"getdetachedelements"}),(0,l.yg)("strong",{parentName:"h3"},"getDetachedElements"),"()"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"IHeapNode"),"[]"),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts#L48"},"heap-analysis/src/plugins/DetachedDOMElementAnalysis.ts:48"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/3531de3b.cc1adde6.js b/assets/js/3531de3b.2f99d91d.js similarity index 88% rename from assets/js/3531de3b.cc1adde6.js rename to assets/js/3531de3b.2f99d91d.js index dfb766acc..f6de7317f 100644 --- a/assets/js/3531de3b.cc1adde6.js +++ b/assets/js/3531de3b.2f99d91d.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9477],{5680:(e,r,n)=>{n.d(r,{xA:()=>p,yg:()=>f});var t=n(6540);function o(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function a(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function s(e){for(var r=1;r=0||(o[n]=e[n]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=t.createContext({}),c=function(e){var r=t.useContext(l),n=r;return e&&(n="function"==typeof e?e(r):s(s({},r),e)),n},p=function(e){var r=c(e.components);return t.createElement(l.Provider,{value:r},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var r=e.children;return t.createElement(t.Fragment,{},r)}},m=t.forwardRef((function(e,r){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=c(n),m=o,f=u["".concat(l,".").concat(m)]||u[m]||g[m]||a;return n?t.createElement(f,s(s({ref:r},p),{},{components:n})):t.createElement(f,s({ref:r},p))}));function f(e,r){var n=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var a=n.length,s=new Array(a);s[0]=m;var i={};for(var l in r)hasOwnProperty.call(r,l)&&(i[l]=r[l]);i.originalType=e,i[u]="string"==typeof e?e:o,s[1]=i;for(var c=2;c{n.r(r),n.d(r,{assets:()=>l,contentTitle:()=>s,default:()=>g,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var t=n(8168),o=(n(6540),n(5680));const a={id:"core_src.IBrowserInfo",title:"Interface: IBrowserInfo",sidebar_label:"IBrowserInfo",custom_edit_url:null},s=void 0,i={unversionedId:"api/interfaces/core_src.IBrowserInfo",id:"api/interfaces/core_src.IBrowserInfo",title:"Interface: IBrowserInfo",description:"This data structure contains the input configuration for the browser and",source:"@site/docs/api/interfaces/core_src.IBrowserInfo.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IBrowserInfo",permalink:"/memlab/docs/api/interfaces/core_src.IBrowserInfo",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IBrowserInfo",title:"Interface: IBrowserInfo",sidebar_label:"IBrowserInfo",custom_edit_url:null},sidebar:"sidebar",previous:{title:"StringAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"},next:{title:"IHeapEdge",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdge"}},l={},c=[{value:"Properties",id:"properties",level:2},{value:' _browserVersion: string',id:"-_browserversion-string",level:3},{value:' _consoleMessages: string[]',id:"-_consolemessages-string",level:3},{value:' _puppeteerConfig: LaunchOptions',id:"-_puppeteerconfig-launchoptions",level:3}],p={toc:c},u="wrapper";function g(e){let{components:r,...n}=e;return(0,o.yg)(u,(0,t.A)({},p,n,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"This data structure contains the input configuration for the browser and\noutput data from the browser. You can retrieve the instance of this type\nthrough ",(0,o.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#runmetainfo"},"RunMetaInfo"),"."),(0,o.yg)("h2",{id:"properties"},"Properties"),(0,o.yg)("h3",{id:"-_browserversion-string"},(0,o.yg)("a",{id:"\\_browserversion",name:"\\_browserversion"})," ",(0,o.yg)("strong",{parentName:"h3"},"_","browserVersion"),": ",(0,o.yg)("inlineCode",{parentName:"h3"},"string")),(0,o.yg)("p",null,"browser version"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("strong",{parentName:"li"},"Source"),":",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1232"},"core/src/lib/Types.ts:1232"))))),(0,o.yg)("hr",null),(0,o.yg)("h3",{id:"-_consolemessages-string"},(0,o.yg)("a",{id:"\\_consolemessages",name:"\\_consolemessages"})," ",(0,o.yg)("strong",{parentName:"h3"},"_","consoleMessages"),": ",(0,o.yg)("inlineCode",{parentName:"h3"},"string"),"[]"),(0,o.yg)("p",null,"all web console output"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("strong",{parentName:"li"},"Source"),":",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1240"},"core/src/lib/Types.ts:1240"))))),(0,o.yg)("hr",null),(0,o.yg)("h3",{id:"-_puppeteerconfig-launchoptions"},(0,o.yg)("a",{id:"\\_puppeteerconfig",name:"\\_puppeteerconfig"})," ",(0,o.yg)("strong",{parentName:"h3"},"_","puppeteerConfig"),": ",(0,o.yg)("inlineCode",{parentName:"h3"},"LaunchOptions")),(0,o.yg)("p",null,"configuration for puppeteer"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("strong",{parentName:"li"},"Source"),":",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1236"},"core/src/lib/Types.ts:1236"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9477],{5680:(e,r,n)=>{n.d(r,{xA:()=>p,yg:()=>m});var t=n(6540);function o(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function a(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function s(e){for(var r=1;r=0||(o[n]=e[n]);return o}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=t.createContext({}),c=function(e){var r=t.useContext(l),n=r;return e&&(n="function"==typeof e?e(r):s(s({},r),e)),n},p=function(e){var r=c(e.components);return t.createElement(l.Provider,{value:r},e.children)},u="mdxType",g={inlineCode:"code",wrapper:function(e){var r=e.children;return t.createElement(t.Fragment,{},r)}},f=t.forwardRef((function(e,r){var n=e.components,o=e.mdxType,a=e.originalType,l=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=c(n),f=o,m=u["".concat(l,".").concat(f)]||u[f]||g[f]||a;return n?t.createElement(m,s(s({ref:r},p),{},{components:n})):t.createElement(m,s({ref:r},p))}));function m(e,r){var n=arguments,o=r&&r.mdxType;if("string"==typeof e||o){var a=n.length,s=new Array(a);s[0]=f;var i={};for(var l in r)hasOwnProperty.call(r,l)&&(i[l]=r[l]);i.originalType=e,i[u]="string"==typeof e?e:o,s[1]=i;for(var c=2;c{n.r(r),n.d(r,{assets:()=>l,contentTitle:()=>s,default:()=>g,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var t=n(8168),o=(n(6540),n(5680));const a={id:"core_src.IBrowserInfo",title:"Interface: IBrowserInfo",sidebar_label:"IBrowserInfo",custom_edit_url:null},s=void 0,i={unversionedId:"api/interfaces/core_src.IBrowserInfo",id:"api/interfaces/core_src.IBrowserInfo",title:"Interface: IBrowserInfo",description:"This data structure contains the input configuration for the browser and",source:"@site/docs/api/interfaces/core_src.IBrowserInfo.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IBrowserInfo",permalink:"/memlab/docs/api/interfaces/core_src.IBrowserInfo",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IBrowserInfo",title:"Interface: IBrowserInfo",sidebar_label:"IBrowserInfo",custom_edit_url:null},sidebar:"sidebar",previous:{title:"StringAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"},next:{title:"IHeapEdge",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdge"}},l={},c=[{value:"Properties",id:"properties",level:2},{value:' _browserVersion: string',id:"-_browserversion-string",level:3},{value:' _consoleMessages: string[]',id:"-_consolemessages-string",level:3},{value:' _puppeteerConfig: LaunchOptions',id:"-_puppeteerconfig-launchoptions",level:3}],p={toc:c},u="wrapper";function g(e){let{components:r,...n}=e;return(0,o.yg)(u,(0,t.A)({},p,n,{components:r,mdxType:"MDXLayout"}),(0,o.yg)("p",null,"This data structure contains the input configuration for the browser and\noutput data from the browser. You can retrieve the instance of this type\nthrough ",(0,o.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#runmetainfo"},"RunMetaInfo"),"."),(0,o.yg)("h2",{id:"properties"},"Properties"),(0,o.yg)("h3",{id:"-_browserversion-string"},(0,o.yg)("a",{id:"\\_browserversion",name:"\\_browserversion"})," ",(0,o.yg)("strong",{parentName:"h3"},"_","browserVersion"),": ",(0,o.yg)("inlineCode",{parentName:"h3"},"string")),(0,o.yg)("p",null,"browser version"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("strong",{parentName:"li"},"Source"),":",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1232"},"core/src/lib/Types.ts:1232"))))),(0,o.yg)("hr",null),(0,o.yg)("h3",{id:"-_consolemessages-string"},(0,o.yg)("a",{id:"\\_consolemessages",name:"\\_consolemessages"})," ",(0,o.yg)("strong",{parentName:"h3"},"_","consoleMessages"),": ",(0,o.yg)("inlineCode",{parentName:"h3"},"string"),"[]"),(0,o.yg)("p",null,"all web console output"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("strong",{parentName:"li"},"Source"),":",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1240"},"core/src/lib/Types.ts:1240"))))),(0,o.yg)("hr",null),(0,o.yg)("h3",{id:"-_puppeteerconfig-launchoptions"},(0,o.yg)("a",{id:"\\_puppeteerconfig",name:"\\_puppeteerconfig"})," ",(0,o.yg)("strong",{parentName:"h3"},"_","puppeteerConfig"),": ",(0,o.yg)("inlineCode",{parentName:"h3"},"LaunchOptions")),(0,o.yg)("p",null,"configuration for puppeteer"),(0,o.yg)("ul",null,(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("strong",{parentName:"li"},"Source"),":",(0,o.yg)("ul",{parentName:"li"},(0,o.yg)("li",{parentName:"ul"},(0,o.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1236"},"core/src/lib/Types.ts:1236"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/4527bbe9.dff82b54.js b/assets/js/4527bbe9.77342189.js similarity index 98% rename from assets/js/4527bbe9.dff82b54.js rename to assets/js/4527bbe9.77342189.js index e36422623..bc6c7f692 100644 --- a/assets/js/4527bbe9.dff82b54.js +++ b/assets/js/4527bbe9.77342189.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2625],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var l=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function t(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=l.createContext({}),p=function(e){var a=l.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return l.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},u=l.forwardRef((function(e,a){var n=e.components,s=e.mdxType,t=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),u=s,g=c["".concat(o,".").concat(u)]||c[u]||m[u]||t;return n?l.createElement(g,i(i({ref:a},y),{},{components:n})):l.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var t=n.length,i=new Array(t);i[0]=u;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>t,metadata:()=>r,toc:()=>p});var l=n(8168),s=(n(6540),n(5680));const t={id:"heap_analysis_src.GlobalVariableAnalysis",title:"Class: GlobalVariableAnalysis",sidebar_label:"GlobalVariableAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.GlobalVariableAnalysis",id:"api/classes/heap_analysis_src.GlobalVariableAnalysis",title:"Class: GlobalVariableAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.GlobalVariableAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.GlobalVariableAnalysis",title:"Class: GlobalVariableAnalysis",sidebar_label:"GlobalVariableAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"DetachedDOMElementAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"},next:{title:"ObjectFanoutAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new GlobalVariableAnalysis()',id:"new-globalvariableanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,l.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"GlobalVariableAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-globalvariableanalysis"},(0,s.yg)("a",{id:"new globalvariableanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new GlobalVariableAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/GlobalVariableAnalysis/GlobalVariableAnalysis.ts#L25"},"heap-analysis/src/plugins/GlobalVariableAnalysis/GlobalVariableAnalysis.ts:25"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2625],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var l=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function t(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=l.createContext({}),p=function(e){var a=l.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return l.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},u=l.forwardRef((function(e,a){var n=e.components,s=e.mdxType,t=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),u=s,g=c["".concat(o,".").concat(u)]||c[u]||m[u]||t;return n?l.createElement(g,i(i({ref:a},y),{},{components:n})):l.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var t=n.length,i=new Array(t);i[0]=u;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>t,metadata:()=>r,toc:()=>p});var l=n(8168),s=(n(6540),n(5680));const t={id:"heap_analysis_src.GlobalVariableAnalysis",title:"Class: GlobalVariableAnalysis",sidebar_label:"GlobalVariableAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.GlobalVariableAnalysis",id:"api/classes/heap_analysis_src.GlobalVariableAnalysis",title:"Class: GlobalVariableAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.GlobalVariableAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.GlobalVariableAnalysis",title:"Class: GlobalVariableAnalysis",sidebar_label:"GlobalVariableAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"DetachedDOMElementAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"},next:{title:"ObjectFanoutAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new GlobalVariableAnalysis()',id:"new-globalvariableanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,l.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"GlobalVariableAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-globalvariableanalysis"},(0,s.yg)("a",{id:"new globalvariableanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new GlobalVariableAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/GlobalVariableAnalysis/GlobalVariableAnalysis.ts#L25"},"heap-analysis/src/plugins/GlobalVariableAnalysis/GlobalVariableAnalysis.ts:25"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5a17db6f.0d7c34cf.js b/assets/js/5a17db6f.80b42791.js similarity index 98% rename from assets/js/5a17db6f.0d7c34cf.js rename to assets/js/5a17db6f.80b42791.js index f3821759b..e125f3c01 100644 --- a/assets/js/5a17db6f.0d7c34cf.js +++ b/assets/js/5a17db6f.80b42791.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8807],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),u=s,g=c["".concat(o,".").concat(u)]||c[u]||m[u]||l;return n?t.createElement(g,i(i({ref:a},y),{},{components:n})):t.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var l=n.length,i=new Array(l);i[0]=u;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const l={id:"heap_analysis_src.ObjectSizeAnalysis",title:"Class: ObjectSizeAnalysis",sidebar_label:"ObjectSizeAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectSizeAnalysis",id:"api/classes/heap_analysis_src.ObjectSizeAnalysis",title:"Class: ObjectSizeAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectSizeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectSizeAnalysis",title:"Class: ObjectSizeAnalysis",sidebar_label:"ObjectSizeAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectShapeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"},next:{title:"ObjectUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectSizeAnalysis()',id:"new-objectsizeanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ObjectSizeAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-objectsizeanalysis"},(0,s.yg)("a",{id:"new objectsizeanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ObjectSizeAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ObjectSizeAnalysis.ts#L20"},"heap-analysis/src/plugins/ObjectSizeAnalysis.ts:20"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8807],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),u=s,g=c["".concat(o,".").concat(u)]||c[u]||m[u]||l;return n?t.createElement(g,i(i({ref:a},y),{},{components:n})):t.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var l=n.length,i=new Array(l);i[0]=u;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const l={id:"heap_analysis_src.ObjectSizeAnalysis",title:"Class: ObjectSizeAnalysis",sidebar_label:"ObjectSizeAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectSizeAnalysis",id:"api/classes/heap_analysis_src.ObjectSizeAnalysis",title:"Class: ObjectSizeAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectSizeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectSizeAnalysis",title:"Class: ObjectSizeAnalysis",sidebar_label:"ObjectSizeAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectShapeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"},next:{title:"ObjectUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectSizeAnalysis()',id:"new-objectsizeanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ObjectSizeAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-objectsizeanalysis"},(0,s.yg)("a",{id:"new objectsizeanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ObjectSizeAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ObjectSizeAnalysis.ts#L20"},"heap-analysis/src/plugins/ObjectSizeAnalysis.ts:20"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5b1d4bc5.ef44b4eb.js b/assets/js/5b1d4bc5.d45742d0.js similarity index 97% rename from assets/js/5b1d4bc5.ef44b4eb.js rename to assets/js/5b1d4bc5.d45742d0.js index f10694155..69089f523 100644 --- a/assets/js/5b1d4bc5.ef44b4eb.js +++ b/assets/js/5b1d4bc5.d45742d0.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9439],{5680:(e,a,n)=>{n.d(a,{xA:()=>m,yg:()=>d});var s=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var o=s.createContext({}),r=function(e){var a=s.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},m=function(e){var a=r(e.components);return s.createElement(o.Provider,{value:a},e.children)},y="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return s.createElement(s.Fragment,{},a)}},h=s.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,o=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),y=r(n),h=t,d=y["".concat(o,".").concat(h)]||y[h]||g[h]||l;return n?s.createElement(d,i(i({ref:a},m),{},{components:n})):s.createElement(d,i({ref:a},m))}));function d(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=h;var p={};for(var o in a)hasOwnProperty.call(a,o)&&(p[o]=a[o]);p.originalType=e,p[y]="string"==typeof e?e:t,i[1]=p;for(var r=2;r{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>g,frontMatter:()=>l,metadata:()=>p,toc:()=>r});var s=n(8168),t=(n(6540),n(5680));const l={id:"heap_analysis_src",title:"Package: @memlab/heap-analysis",sidebar_label:"heap-analysis/src",sidebar_position:0,custom_edit_url:null},i=void 0,p={unversionedId:"api/modules/heap_analysis_src",id:"api/modules/heap_analysis_src",title:"Package: @memlab/heap-analysis",description:"Classes",source:"@site/docs/api/modules/heap_analysis_src.md",sourceDirName:"api/modules",slug:"/api/modules/heap_analysis_src",permalink:"/memlab/docs/api/modules/heap_analysis_src",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"heap_analysis_src",title:"Package: @memlab/heap-analysis",sidebar_label:"heap-analysis/src",sidebar_position:0,custom_edit_url:null},sidebar:"sidebar",previous:{title:"core/src",permalink:"/memlab/docs/api/modules/core_src"},next:{title:"ConsoleMode",permalink:"/memlab/docs/api/enums/api_src.ConsoleMode"}},o={},r=[{value:"Classes",id:"classes",level:2},{value:"Type Aliases",id:"type-aliases",level:2},{value:' AnalyzeSnapshotResult: Object',id:"-analyzesnapshotresult-object",level:3},{value:' HeapAnalysisOptions: Object',id:"-heapanalysisoptions-object",level:3},{value:' RunHeapAnalysisOptions: Object',id:"-runheapanalysisoptions-object",level:3},{value:"Functions",id:"functions",level:2},{value:'getDominatorNodes(ids, snapshot)',id:"getdominatornodesids-snapshot",level:3},{value:'getFullHeapFromFile(file)',id:"getfullheapfromfilefile",level:3},{value:'getHeapFromFile(file)',id:"getheapfromfilefile",level:3},{value:'getSnapshotDirForAnalysis(options)',id:"getsnapshotdirforanalysisoptions",level:3},{value:'getSnapshotFileForAnalysis(options)',id:"getsnapshotfileforanalysisoptions",level:3},{value:'loadHeapSnapshot(options)',id:"loadheapsnapshotoptions",level:3},{value:'snapshotMapReduce<T1, T2>(mapCallback, reduceCallback, options)',id:"snapshotmapreducet1-t2mapcallback-reducecallback-options",level:3},{value:"Type parameters",id:"type-parameters",level:4},{value:'takeNodeFullHeap()',id:"takenodefullheap",level:3}],m={toc:r},y="wrapper";function g(e){let{components:a,...n}=e;return(0,t.yg)(y,(0,s.A)({},m,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h2",{id:"classes"},"Classes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},"BaseAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"},"CollectionsHoldingStaleAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"},"DetachedDOMElementAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"},"GlobalVariableAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"},"ObjectFanoutAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"},"ObjectShallowAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"},"ObjectShapeAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"},"ObjectSizeAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"},"ObjectUnboundGrowthAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"},"ShapeUnboundGrowthAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"},"StringAnalysis"))),(0,t.yg)("h2",{id:"type-aliases"},"Type Aliases"),(0,t.yg)("h3",{id:"-analyzesnapshotresult-object"},(0,t.yg)("a",{id:"analyzesnapshotresult",name:"analyzesnapshotresult"})," ",(0,t.yg)("strong",{parentName:"h3"},"AnalyzeSnapshotResult"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"Object")),(0,t.yg)("p",null,"This is the return type from calling ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotfromfile"},"analyzeSnapshotFromFile"),"\nor ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotsindirectory"},"analyzeSnapshotsInDirectory"),"."),(0,t.yg)("table",null,(0,t.yg)("thead",{parentName:"table"},(0,t.yg)("tr",{parentName:"thead"},(0,t.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,t.yg)("tbody",{parentName:"table"},(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"analysisOutputFile")),(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"string")),(0,t.yg)("td",{parentName:"tr",align:"left"},"file path of the console output of the heap analysis call")))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L93"},"heap-analysis/src/PluginUtils.ts:93"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-heapanalysisoptions-object"},(0,t.yg)("a",{id:"heapanalysisoptions",name:"heapanalysisoptions"})," ",(0,t.yg)("strong",{parentName:"h3"},"HeapAnalysisOptions"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"Object")),(0,t.yg)("p",null,"This is the auto-generated arguments passed to all the ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," method\nthat your self-defined heap analysis should implement.\nYou are not supposed to construct instances of this class."),(0,t.yg)("p",null,"For code examples on how this options could be used, see\n",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#getsnapshotfileforanalysis"},"getSnapshotFileForAnalysis"),", ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#loadheapsnapshot"},"loadHeapSnapshot"),",\nor ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#snapshotmapreduce"},"snapshotMapReduce"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L70"},"heap-analysis/src/PluginUtils.ts:70"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-runheapanalysisoptions-object"},(0,t.yg)("a",{id:"runheapanalysisoptions",name:"runheapanalysisoptions"})," ",(0,t.yg)("strong",{parentName:"h3"},"RunHeapAnalysisOptions"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"Object")),(0,t.yg)("p",null,"This is the input option for ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotfromfile"},"analyzeSnapshotFromFile"),"\nand ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotsindirectory"},"analyzeSnapshotsInDirectory"),"."),(0,t.yg)("table",null,(0,t.yg)("thead",{parentName:"table"},(0,t.yg)("tr",{parentName:"thead"},(0,t.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,t.yg)("tbody",{parentName:"table"},(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"workDir?")),(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"string")),(0,t.yg)("td",{parentName:"tr",align:"left"},"specify the working directory to where the intermediate, logging, and output files should be saved")))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L81"},"heap-analysis/src/PluginUtils.ts:81"))))),(0,t.yg)("h2",{id:"functions"},"Functions"),(0,t.yg)("h3",{id:"getdominatornodesids-snapshot"},(0,t.yg)("a",{id:"getdominatornodes"}),(0,t.yg)("strong",{parentName:"h3"},"getDominatorNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"ids"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"snapshot"),")"),(0,t.yg)("p",null,"This API calculate the set of\n",(0,t.yg)("a",{parentName:"p",href:"https://firefox-source-docs.mozilla.org/devtools-user/memory/dominators/index.html"},"dominator nodes"),"\nof the set of input heap objects."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"ids"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"number"),">"," | Set of ids of heap objects (or nodes)"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot")," | heap loaded from a heap snapshot"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"number"),">"," | the set of dominator nodes/objects"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile, getDominatorNodes} from '@memlab/heap-analysis';\n\nclass TestObject {}\n\n(async function () {\n const t1 = new TestObject();\n const t2 = new TestObject();\n\n // dump the heap of this running JavaScript program\n const heapFile = dumpNodeHeapSnapshot();\n const heap = await getFullHeapFromFile(heapFile);\n\n // find the heap node for TestObject\n let nodes = [];\n heap.nodes.forEach(node => {\n if (node.name === 'TestObject' && node.type === 'object') {\n nodes.push(node);\n }\n });\n\n // get the dominator nodes\n const dominatorIds = getDominatorNodes(\n new Set(nodes.map(node => node.id)),\n heap,\n );\n})();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L757"},"heap-analysis/src/PluginUtils.ts:757"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getfullheapfromfilefile"},(0,t.yg)("a",{id:"getfullheapfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"getFullHeapFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),")"),(0,t.yg)("p",null,"Load and parse a ",(0,t.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," file and calculate meta data like\ndominator nodes and retained sizes."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),">"," | the heap graph representation instance that supports querying\nthe heap"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function (){\n const heapFile = dumpNodeHeapSnapshot();\n const heap = await getFullHeapFromFile(heapFile);\n})();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L554"},"heap-analysis/src/PluginUtils.ts:554"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getheapfromfilefile"},(0,t.yg)("a",{id:"getheapfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"getHeapFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),")"),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"deprecated"))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L585"},"heap-analysis/src/PluginUtils.ts:585"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getsnapshotdirforanalysisoptions"},(0,t.yg)("a",{id:"getsnapshotdirforanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"getSnapshotDirForAnalysis"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Get the absolute path of the directory holding all the heap snapshot files\npassed to the hosting heap analysis via ",(0,t.yg)("inlineCode",{parentName:"p"},"HeapAnalysisOptions"),"."),(0,t.yg)("p",null,"This API is supposed to be used within the overridden ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," method\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Nullable"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"string"),">"," | the absolute path of the directory"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {getSnapshotFileForAnalysis, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n const directory = getSnapshotDirForAnalysis(options);\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// any .heapsnapshot file recorded by memlab or saved manually from Chrome\nawait analysis.analyzeSnapshotFromFile(snapshotFile);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"getSnapshotDirForAnalysis")," use the snapshot directory from\n",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L466"},"heap-analysis/src/PluginUtils.ts:466"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getsnapshotfileforanalysisoptions"},(0,t.yg)("a",{id:"getsnapshotfileforanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"getSnapshotFileForAnalysis"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Get the heap snapshot file's absolute path passed to the hosting heap\nanalysis via ",(0,t.yg)("inlineCode",{parentName:"p"},"HeapAnalysisOptions"),"."),(0,t.yg)("p",null,"This API is supposed to be used within the overridden ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," method\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the heap snapshot file"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {getSnapshotFileForAnalysis, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n const file = getSnapshotFileForAnalysis(options);\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// any .heapsnapshot file recorded by memlab or saved manually from Chrome\nawait analysis.analyzeSnapshotFromFile(snapshotFile);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"getSnapshotFileForAnalysis")," will use the last heap snapshot in alphanumerically\nascending order from ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L417"},"heap-analysis/src/PluginUtils.ts:417"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"loadheapsnapshotoptions"},(0,t.yg)("a",{id:"loadheapsnapshot"}),(0,t.yg)("strong",{parentName:"h3"},"loadHeapSnapshot"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Load the heap graph based on the single JavaScript heap snapshot\npassed to the hosting heap analysis via ",(0,t.yg)("inlineCode",{parentName:"p"},"HeapAnalysisOptions"),"."),(0,t.yg)("p",null,"This API is supposed to be used within the ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," implementation\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),">"," | the graph representation of the heap"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {loadHeapSnapshot, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n const heap = await loadHeapSnapshot(options);\n // doing heap analysis\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// any .heapsnapshot file recorded by memlab or saved manually from Chrome\nawait analysis.analyzeSnapshotFromFile(snapshotFile);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"loadHeapSnapshot")," will use the last heap snapshot in alphanumerically\nascending order from ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L520"},"heap-analysis/src/PluginUtils.ts:520"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"snapshotmapreducet1-t2mapcallback-reducecallback-options"},(0,t.yg)("a",{id:"snapshotmapreduce"}),(0,t.yg)("strong",{parentName:"h3"},"snapshotMapReduce"),"<",(0,t.yg)("inlineCode",{parentName:"h3"},"T1"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"T2"),">","(",(0,t.yg)("inlineCode",{parentName:"h3"},"mapCallback"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"reduceCallback"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"When a heap analysis is taking multiple heap snapshots as input for memory\nanalysis (e.g., finding which object keeps growing in size in a series of\nheap snapshots), this API could be used to do\n",(0,t.yg)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/MapReduce"},"MapRedue")," on all heap snapshots."),(0,t.yg)("p",null,"This API is supposed to be used within the ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," implementation\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance that is designed to analyze multiple heap\nsnapshots (as an example, finding which object keeps growing overtime)"),(0,t.yg)("h4",{id:"type-parameters"},"Type parameters"),(0,t.yg)("table",null,(0,t.yg)("thead",{parentName:"table"},(0,t.yg)("tr",{parentName:"thead"},(0,t.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,t.yg)("tbody",{parentName:"table"},(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"T1")),(0,t.yg)("td",{parentName:"tr",align:"left"},"the type of the intermediate result from each map function call")),(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"T2")),(0,t.yg)("td",{parentName:"tr",align:"left"},"the type of the final result of the reduce function call")))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"mapCallback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"i"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string"),") => ",(0,t.yg)("inlineCode",{parentName:"li"},"T1")," | the map function in MapReduce, the function will be applied to each heap snapshot"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"reduceCallback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"results"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"T1"),"[]) => ",(0,t.yg)("inlineCode",{parentName:"li"},"T2")," | the reduce function in MapReduce, the function will take as input all intermediate results from all map function calls"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"T2"),">"," | the return value of your reduce function"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {snapshotMapReduce, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n // check if the number of heap objects keeps growing overtime\n const isMonotonicIncreasing = await snapshotMapReduce(\n (heap) => heap.nodes.length,\n (nodeCounts) =>\n nodeCounts[0] < nodeCounts[nodeCounts.length - 1] &&\n nodeCounts.every((count, i) => i === 0 || count >= nodeCounts[i - 1]),\n options,\n );\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// snapshotDir includes a series of .heapsnapshot files recorded by\n// memlab or saved manually from Chrome, those files will be loaded\n// in alphanumerically ascending order\nawait analysis.analyzeSnapshotsInDirectory(snapshotDir);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"snapshotMapReduce")," will use all the heap snapshot in alphanumerically\nascending order from ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"Why not passing in all heap snapshots as an array of ",(0,t.yg)("a",{parentName:"strong",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"),"s?"),"\nEach heap snapshot could be non-trivial in size, loading them all at once\nmay not be possible."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L662"},"heap-analysis/src/PluginUtils.ts:662"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"takenodefullheap"},(0,t.yg)("a",{id:"takenodefullheap"}),(0,t.yg)("strong",{parentName:"h3"},"takeNodeFullHeap"),"()"),(0,t.yg)("p",null,"Take a heap snapshot of the current program state\nand parse it as ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"),". This\nAPI also calculates some heap analysis meta data\nfor heap analysis. But this also means slower heap parsing\ncomparing with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#takenodeminimalheap"},"takeNodeMinimalHeap"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapSnapshot"),">"," | heap representation with heap analysis meta data.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples:")))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {takeNodeFullHeap} from '@memlab/heap-analysis';\n\n(async function () {\n const heap: IHeapSnapshot = await takeNodeFullHeap();\n})();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/PluginUtils.ts#L577"},"heap-analysis/src/PluginUtils.ts:577"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9439],{5680:(e,a,n)=>{n.d(a,{xA:()=>m,yg:()=>d});var s=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var o=s.createContext({}),r=function(e){var a=s.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},m=function(e){var a=r(e.components);return s.createElement(o.Provider,{value:a},e.children)},y="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return s.createElement(s.Fragment,{},a)}},h=s.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,o=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),y=r(n),h=t,d=y["".concat(o,".").concat(h)]||y[h]||g[h]||l;return n?s.createElement(d,i(i({ref:a},m),{},{components:n})):s.createElement(d,i({ref:a},m))}));function d(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=h;var p={};for(var o in a)hasOwnProperty.call(a,o)&&(p[o]=a[o]);p.originalType=e,p[y]="string"==typeof e?e:t,i[1]=p;for(var r=2;r{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>g,frontMatter:()=>l,metadata:()=>p,toc:()=>r});var s=n(8168),t=(n(6540),n(5680));const l={id:"heap_analysis_src",title:"Package: @memlab/heap-analysis",sidebar_label:"heap-analysis/src",sidebar_position:0,custom_edit_url:null},i=void 0,p={unversionedId:"api/modules/heap_analysis_src",id:"api/modules/heap_analysis_src",title:"Package: @memlab/heap-analysis",description:"Classes",source:"@site/docs/api/modules/heap_analysis_src.md",sourceDirName:"api/modules",slug:"/api/modules/heap_analysis_src",permalink:"/memlab/docs/api/modules/heap_analysis_src",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"heap_analysis_src",title:"Package: @memlab/heap-analysis",sidebar_label:"heap-analysis/src",sidebar_position:0,custom_edit_url:null},sidebar:"sidebar",previous:{title:"core/src",permalink:"/memlab/docs/api/modules/core_src"},next:{title:"ConsoleMode",permalink:"/memlab/docs/api/enums/api_src.ConsoleMode"}},o={},r=[{value:"Classes",id:"classes",level:2},{value:"Type Aliases",id:"type-aliases",level:2},{value:' AnalyzeSnapshotResult: Object',id:"-analyzesnapshotresult-object",level:3},{value:' HeapAnalysisOptions: Object',id:"-heapanalysisoptions-object",level:3},{value:' RunHeapAnalysisOptions: Object',id:"-runheapanalysisoptions-object",level:3},{value:"Functions",id:"functions",level:2},{value:'getDominatorNodes(ids, snapshot)',id:"getdominatornodesids-snapshot",level:3},{value:'getFullHeapFromFile(file)',id:"getfullheapfromfilefile",level:3},{value:'getHeapFromFile(file)',id:"getheapfromfilefile",level:3},{value:'getSnapshotDirForAnalysis(options)',id:"getsnapshotdirforanalysisoptions",level:3},{value:'getSnapshotFileForAnalysis(options)',id:"getsnapshotfileforanalysisoptions",level:3},{value:'loadHeapSnapshot(options)',id:"loadheapsnapshotoptions",level:3},{value:'snapshotMapReduce<T1, T2>(mapCallback, reduceCallback, options)',id:"snapshotmapreducet1-t2mapcallback-reducecallback-options",level:3},{value:"Type parameters",id:"type-parameters",level:4},{value:'takeNodeFullHeap()',id:"takenodefullheap",level:3}],m={toc:r},y="wrapper";function g(e){let{components:a,...n}=e;return(0,t.yg)(y,(0,s.A)({},m,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h2",{id:"classes"},"Classes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},"BaseAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis"},"CollectionsHoldingStaleAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"},"DetachedDOMElementAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"},"GlobalVariableAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"},"ObjectFanoutAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"},"ObjectShallowAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"},"ObjectShapeAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"},"ObjectSizeAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"},"ObjectUnboundGrowthAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis"},"ShapeUnboundGrowthAnalysis")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"},"StringAnalysis"))),(0,t.yg)("h2",{id:"type-aliases"},"Type Aliases"),(0,t.yg)("h3",{id:"-analyzesnapshotresult-object"},(0,t.yg)("a",{id:"analyzesnapshotresult",name:"analyzesnapshotresult"})," ",(0,t.yg)("strong",{parentName:"h3"},"AnalyzeSnapshotResult"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"Object")),(0,t.yg)("p",null,"This is the return type from calling ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotfromfile"},"analyzeSnapshotFromFile"),"\nor ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotsindirectory"},"analyzeSnapshotsInDirectory"),"."),(0,t.yg)("table",null,(0,t.yg)("thead",{parentName:"table"},(0,t.yg)("tr",{parentName:"thead"},(0,t.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,t.yg)("tbody",{parentName:"table"},(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"analysisOutputFile")),(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"string")),(0,t.yg)("td",{parentName:"tr",align:"left"},"file path of the console output of the heap analysis call")))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L93"},"heap-analysis/src/PluginUtils.ts:93"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-heapanalysisoptions-object"},(0,t.yg)("a",{id:"heapanalysisoptions",name:"heapanalysisoptions"})," ",(0,t.yg)("strong",{parentName:"h3"},"HeapAnalysisOptions"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"Object")),(0,t.yg)("p",null,"This is the auto-generated arguments passed to all the ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," method\nthat your self-defined heap analysis should implement.\nYou are not supposed to construct instances of this class."),(0,t.yg)("p",null,"For code examples on how this options could be used, see\n",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#getsnapshotfileforanalysis"},"getSnapshotFileForAnalysis"),", ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#loadheapsnapshot"},"loadHeapSnapshot"),",\nor ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/heap_analysis_src#snapshotmapreduce"},"snapshotMapReduce"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L70"},"heap-analysis/src/PluginUtils.ts:70"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-runheapanalysisoptions-object"},(0,t.yg)("a",{id:"runheapanalysisoptions",name:"runheapanalysisoptions"})," ",(0,t.yg)("strong",{parentName:"h3"},"RunHeapAnalysisOptions"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"Object")),(0,t.yg)("p",null,"This is the input option for ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotfromfile"},"analyzeSnapshotFromFile"),"\nand ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis#analyzesnapshotsindirectory"},"analyzeSnapshotsInDirectory"),"."),(0,t.yg)("table",null,(0,t.yg)("thead",{parentName:"table"},(0,t.yg)("tr",{parentName:"thead"},(0,t.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,t.yg)("tbody",{parentName:"table"},(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"workDir?")),(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"string")),(0,t.yg)("td",{parentName:"tr",align:"left"},"specify the working directory to where the intermediate, logging, and output files should be saved")))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L81"},"heap-analysis/src/PluginUtils.ts:81"))))),(0,t.yg)("h2",{id:"functions"},"Functions"),(0,t.yg)("h3",{id:"getdominatornodesids-snapshot"},(0,t.yg)("a",{id:"getdominatornodes"}),(0,t.yg)("strong",{parentName:"h3"},"getDominatorNodes"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"ids"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"snapshot"),")"),(0,t.yg)("p",null,"This API calculate the set of\n",(0,t.yg)("a",{parentName:"p",href:"https://firefox-source-docs.mozilla.org/devtools-user/memory/dominators/index.html"},"dominator nodes"),"\nof the set of input heap objects."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"ids"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"number"),">"," | Set of ids of heap objects (or nodes)"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot")," | heap loaded from a heap snapshot"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"number"),">"," | the set of dominator nodes/objects"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile, getDominatorNodes} from '@memlab/heap-analysis';\n\nclass TestObject {}\n\n(async function () {\n const t1 = new TestObject();\n const t2 = new TestObject();\n\n // dump the heap of this running JavaScript program\n const heapFile = dumpNodeHeapSnapshot();\n const heap = await getFullHeapFromFile(heapFile);\n\n // find the heap node for TestObject\n let nodes = [];\n heap.nodes.forEach(node => {\n if (node.name === 'TestObject' && node.type === 'object') {\n nodes.push(node);\n }\n });\n\n // get the dominator nodes\n const dominatorIds = getDominatorNodes(\n new Set(nodes.map(node => node.id)),\n heap,\n );\n})();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L757"},"heap-analysis/src/PluginUtils.ts:757"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getfullheapfromfilefile"},(0,t.yg)("a",{id:"getfullheapfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"getFullHeapFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),")"),(0,t.yg)("p",null,"Load and parse a ",(0,t.yg)("inlineCode",{parentName:"p"},".heapsnapshot")," file and calculate meta data like\ndominator nodes and retained sizes."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),">"," | the heap graph representation instance that supports querying\nthe heap"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function (){\n const heapFile = dumpNodeHeapSnapshot();\n const heap = await getFullHeapFromFile(heapFile);\n})();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L554"},"heap-analysis/src/PluginUtils.ts:554"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getheapfromfilefile"},(0,t.yg)("a",{id:"getheapfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"getHeapFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),")"),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"deprecated"))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),">"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L585"},"heap-analysis/src/PluginUtils.ts:585"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getsnapshotdirforanalysisoptions"},(0,t.yg)("a",{id:"getsnapshotdirforanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"getSnapshotDirForAnalysis"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Get the absolute path of the directory holding all the heap snapshot files\npassed to the hosting heap analysis via ",(0,t.yg)("inlineCode",{parentName:"p"},"HeapAnalysisOptions"),"."),(0,t.yg)("p",null,"This API is supposed to be used within the overridden ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," method\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Nullable"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"string"),">"," | the absolute path of the directory"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {getSnapshotFileForAnalysis, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n const directory = getSnapshotDirForAnalysis(options);\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// any .heapsnapshot file recorded by memlab or saved manually from Chrome\nawait analysis.analyzeSnapshotFromFile(snapshotFile);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"getSnapshotDirForAnalysis")," use the snapshot directory from\n",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L466"},"heap-analysis/src/PluginUtils.ts:466"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getsnapshotfileforanalysisoptions"},(0,t.yg)("a",{id:"getsnapshotfileforanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"getSnapshotFileForAnalysis"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Get the heap snapshot file's absolute path passed to the hosting heap\nanalysis via ",(0,t.yg)("inlineCode",{parentName:"p"},"HeapAnalysisOptions"),"."),(0,t.yg)("p",null,"This API is supposed to be used within the overridden ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," method\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the heap snapshot file"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {getSnapshotFileForAnalysis, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n const file = getSnapshotFileForAnalysis(options);\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// any .heapsnapshot file recorded by memlab or saved manually from Chrome\nawait analysis.analyzeSnapshotFromFile(snapshotFile);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"getSnapshotFileForAnalysis")," will use the last heap snapshot in alphanumerically\nascending order from ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L417"},"heap-analysis/src/PluginUtils.ts:417"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"loadheapsnapshotoptions"},(0,t.yg)("a",{id:"loadheapsnapshot"}),(0,t.yg)("strong",{parentName:"h3"},"loadHeapSnapshot"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"Load the heap graph based on the single JavaScript heap snapshot\npassed to the hosting heap analysis via ",(0,t.yg)("inlineCode",{parentName:"p"},"HeapAnalysisOptions"),"."),(0,t.yg)("p",null,"This API is supposed to be used within the ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," implementation\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),">"," | the graph representation of the heap"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {loadHeapSnapshot, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n const heap = await loadHeapSnapshot(options);\n // doing heap analysis\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// any .heapsnapshot file recorded by memlab or saved manually from Chrome\nawait analysis.analyzeSnapshotFromFile(snapshotFile);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"loadHeapSnapshot")," will use the last heap snapshot in alphanumerically\nascending order from ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L520"},"heap-analysis/src/PluginUtils.ts:520"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"snapshotmapreducet1-t2mapcallback-reducecallback-options"},(0,t.yg)("a",{id:"snapshotmapreduce"}),(0,t.yg)("strong",{parentName:"h3"},"snapshotMapReduce"),"<",(0,t.yg)("inlineCode",{parentName:"h3"},"T1"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"T2"),">","(",(0,t.yg)("inlineCode",{parentName:"h3"},"mapCallback"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"reduceCallback"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options"),")"),(0,t.yg)("p",null,"When a heap analysis is taking multiple heap snapshots as input for memory\nanalysis (e.g., finding which object keeps growing in size in a series of\nheap snapshots), this API could be used to do\n",(0,t.yg)("a",{parentName:"p",href:"https://en.wikipedia.org/wiki/MapReduce"},"MapRedue")," on all heap snapshots."),(0,t.yg)("p",null,"This API is supposed to be used within the ",(0,t.yg)("inlineCode",{parentName:"p"},"process")," implementation\nof an ",(0,t.yg)("inlineCode",{parentName:"p"},"BaseAnalysis")," instance that is designed to analyze multiple heap\nsnapshots (as an example, finding which object keeps growing overtime)"),(0,t.yg)("h4",{id:"type-parameters"},"Type parameters"),(0,t.yg)("table",null,(0,t.yg)("thead",{parentName:"table"},(0,t.yg)("tr",{parentName:"thead"},(0,t.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,t.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,t.yg)("tbody",{parentName:"table"},(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"T1")),(0,t.yg)("td",{parentName:"tr",align:"left"},"the type of the intermediate result from each map function call")),(0,t.yg)("tr",{parentName:"tbody"},(0,t.yg)("td",{parentName:"tr",align:"left"},(0,t.yg)("inlineCode",{parentName:"td"},"T2")),(0,t.yg)("td",{parentName:"tr",align:"left"},"the type of the final result of the reduce function call")))),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"mapCallback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"IHeapSnapshot"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"i"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string"),") => ",(0,t.yg)("inlineCode",{parentName:"li"},"T1")," | the map function in MapReduce, the function will be applied to each heap snapshot"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"reduceCallback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"results"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"T1"),"[]) => ",(0,t.yg)("inlineCode",{parentName:"li"},"T2")," | the reduce function in MapReduce, the function will take as input all intermediate results from all map function calls"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#heapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"HeapAnalysisOptions"))," | this is the auto-generated input passed to all the ",(0,t.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," instances"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"li"},"T2"),">"," | the return value of your reduce function"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples:"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {HeapAnalysisOptions} from '@memlab/heap-analysis';\nimport {snapshotMapReduce, BaseAnalysis} from '@memlab/heap-analysis';\n\nclass ExampleAnalysis extends BaseAnalysis {\n public getCommandName(): string {\n return 'example-analysis';\n }\n\n public getDescription(): string {\n return 'an example analysis for demo';\n }\n\n async process(options: HeapAnalysisOptions): Promise {\n // check if the number of heap objects keeps growing overtime\n const isMonotonicIncreasing = await snapshotMapReduce(\n (heap) => heap.nodes.length,\n (nodeCounts) =>\n nodeCounts[0] < nodeCounts[nodeCounts.length - 1] &&\n nodeCounts.every((count, i) => i === 0 || count >= nodeCounts[i - 1]),\n options,\n );\n }\n}\n")),(0,t.yg)("p",null,"Use the following code to invoke the heap analysis:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ExampleAnalysis();\n// snapshotDir includes a series of .heapsnapshot files recorded by\n// memlab or saved manually from Chrome, those files will be loaded\n// in alphanumerically ascending order\nawait analysis.analyzeSnapshotsInDirectory(snapshotDir);\n")),(0,t.yg)("p",null,"The new heap analysis can also be used with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#analyze"},"analyze"),", in that case\n",(0,t.yg)("inlineCode",{parentName:"p"},"snapshotMapReduce")," will use all the heap snapshot in alphanumerically\nascending order from ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader"),"."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"Why not passing in all heap snapshots as an array of ",(0,t.yg)("a",{parentName:"strong",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"),"s?"),"\nEach heap snapshot could be non-trivial in size, loading them all at once\nmay not be possible."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L662"},"heap-analysis/src/PluginUtils.ts:662"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"takenodefullheap"},(0,t.yg)("a",{id:"takenodefullheap"}),(0,t.yg)("strong",{parentName:"h3"},"takeNodeFullHeap"),"()"),(0,t.yg)("p",null,"Take a heap snapshot of the current program state\nand parse it as ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"),". This\nAPI also calculates some heap analysis meta data\nfor heap analysis. But this also means slower heap parsing\ncomparing with ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#takenodeminimalheap"},"takeNodeMinimalHeap"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapSnapshot"),">"," | heap representation with heap analysis meta data.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples:")))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport type {takeNodeFullHeap} from '@memlab/heap-analysis';\n\n(async function () {\n const heap: IHeapSnapshot = await takeNodeFullHeap();\n})();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/PluginUtils.ts#L577"},"heap-analysis/src/PluginUtils.ts:577"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5be78946.13193e11.js b/assets/js/5be78946.43c9e803.js similarity index 98% rename from assets/js/5be78946.13193e11.js rename to assets/js/5be78946.43c9e803.js index deadc14e6..1f78625a8 100644 --- a/assets/js/5be78946.13193e11.js +++ b/assets/js/5be78946.43c9e803.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8485],{5680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>g});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var s=r.createContext({}),c=function(e){var a=r.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},p=function(e){var a=c(e.components);return r.createElement(s.Provider,{value:a},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},f=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),d=c(n),f=t,g=d["".concat(s,".").concat(f)]||d[f]||m[f]||l;return n?r.createElement(g,i(i({ref:a},p),{},{components:n})):r.createElement(g,i({ref:a},p))}));function g(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=f;var o={};for(var s in a)hasOwnProperty.call(a,s)&&(o[s]=a[s]);o.originalType=e,o[d]="string"==typeof e?e:t,i[1]=o;for(var c=2;c{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var r=n(8168),t=(n(6540),n(5680));const l={id:"core_src.ILeakFilter",title:"Interface: ILeakFilter",sidebar_label:"ILeakFilter",custom_edit_url:null},i=void 0,o={unversionedId:"api/interfaces/core_src.ILeakFilter",id:"api/interfaces/core_src.ILeakFilter",title:"Interface: ILeakFilter",description:"The ILeakFilter interface allows you to define a leak detector and",source:"@site/docs/api/interfaces/core_src.ILeakFilter.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.ILeakFilter",permalink:"/memlab/docs/api/interfaces/core_src.ILeakFilter",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.ILeakFilter",title:"Interface: ILeakFilter",sidebar_label:"ILeakFilter",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapStringNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},next:{title:"IScenario",permalink:"/memlab/docs/api/interfaces/core_src.IScenario"}},s={},c=[{value:"Properties",id:"properties",level:2},{value:' Optional beforeLeakFilter: InitLeakFilterCallback',id:"-optional-beforeleakfilter-initleakfiltercallback",level:3},{value:' Optional leakFilter: LeakFilterCallback',id:"-optional-leakfilter-leakfiltercallback",level:3},{value:' Optional retainerReferenceFilter: ReferenceFilterCallback',id:"-optional-retainerreferencefilter-referencefiltercallback",level:3}],p={toc:c},d="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(d,(0,r.A)({},p,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"The ",(0,t.yg)("inlineCode",{parentName:"p"},"ILeakFilter")," interface allows you to define a leak detector and\ncustomize the leak filtering logic in memlab (instead of using the\nbuilt-in leak filters)."),(0,t.yg)("p",null,"Use the leak filter definition in command line interface to filter\nleaks detected from browser interactions"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab run --scenario --leak-filter \n")),(0,t.yg)("p",null,"If you have already run ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab run")," or ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab snapshot")," which saved\nheap snapshot and other meta data on disk, use the following command\nto filter leaks based on those saved heap snapshots (query the default\ndata location by ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab get-default-work-dir"),")."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab find-leaks --leak-filter \n")),(0,t.yg)("p",null,"Here is an example TypeScript file defining a leak filter.\nThe command line interface only accepts compiled JavaScript file.\nYou can also define the leak filter in JavaScript (without the\ntype annotations."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import {IHeapNode, IHeapSnapshot, HeapNodeIdSet, utils} from '@memlab/core';\n\nfunction initMap(snapshot: IHeapSnapshot): Record {\n const map = Object.create(null);\n snapshot.nodes.forEach(node => {\n if (node.type !== 'string') {\n return;\n }\n const str = utils.getStringNodeValue(node);\n if (str in map) {\n ++map[str];\n } else {\n map[str] = 1;\n }\n });\n return map;\n}\nconst beforeLeakFilter = (snapshot: IHeapSnapshot, _leakedNodeIds: HeapNodeIdSet): void => {\n map = initMap(snapshot);\n};\n\n// duplicated string with size > 1KB as memory leak\nconst leakFilter = (node: IHeapNode): boolean => {\n if (node.type !== 'string' || node.retainedSize < 1000) {\n return false;\n }\n const str = utils.getStringNodeValue(node);\n return map[str] > 1;\n};\n\nexport default {beforeLeakFilter, leakFilter};\n")),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-optional-beforeleakfilter-initleakfiltercallback"},(0,t.yg)("a",{id:"beforeleakfilter",name:"beforeleakfilter"})," ",(0,t.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,t.yg)("strong",{parentName:"h3"},"beforeLeakFilter"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#initleakfiltercallback"},(0,t.yg)("inlineCode",{parentName:"a"},"InitLeakFilterCallback"))),(0,t.yg)("p",null,"Lifecycle function callback that is invoked initially once before\nthe subsequent ",(0,t.yg)("inlineCode",{parentName:"p"},"leakFilter")," function calls. This callback could\nbe used to initialize some data stores or any one-off\npreprocessings."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,t.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,t.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-javascript"},"module.exports = {\n beforeLeakFilter: (snapshot, leakedNodeIds) {\n // initialize some data stores\n },\n leakFilter(node, snapshot, leakedNodeIds) {\n // use the data stores\n },\n};\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L428"},"core/src/lib/Types.ts:428"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-optional-leakfilter-leakfiltercallback"},(0,t.yg)("a",{id:"leakfilter",name:"leakfilter"})," ",(0,t.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,t.yg)("strong",{parentName:"h3"},"leakFilter"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#leakfiltercallback"},(0,t.yg)("inlineCode",{parentName:"a"},"LeakFilterCallback"))),(0,t.yg)("p",null,"This callback defines how you want to filter out the\nleaked objects. The callback is called for every node (JS heap\nobject in browser) allocated by the ",(0,t.yg)("inlineCode",{parentName:"p"},"action")," callback, but not\nreleased after the ",(0,t.yg)("inlineCode",{parentName:"p"},"back")," callback. Those objects could be caches\nthat are retained in memory on purpose, or they are memory leaks."),(0,t.yg)("p",null,"This optional callback allows you to define your own algorithm\nto cherry pick memory leaks for specific JS program under test."),(0,t.yg)("p",null,"If this optional callback is not defined, memlab will use its\nbuilt-in leak filter, which considers detached DOM elements\nand unmounted Fiber nodes (detached from React Fiber tree) as\nmemory leaks."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode"))," | the heap object\nallocated but not released. This filter callback will be applied\nto each node allocated but not released in the heap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,t.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,t.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": the boolean value indicating whether the given node in\nthe snapshot should be considered as leaked.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as leak-filter.js\nmodule.exports = {\n leakFilter(node, snapshot, leakedNodeIds) {\n // any unreleased node (JS heap object) with 1MB+\n // retained size is considered a memory leak\n return node.retainedSize > 1000000;\n },\n};\n")),(0,t.yg)("p",null,"Use the leak filter definition in command line interface:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab find-leaks --leak-filter \n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab run --scenario --leak-filter \n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L480"},"core/src/lib/Types.ts:480"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-optional-retainerreferencefilter-referencefiltercallback"},(0,t.yg)("a",{id:"retainerreferencefilter",name:"retainerreferencefilter"})," ",(0,t.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,t.yg)("strong",{parentName:"h3"},"retainerReferenceFilter"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#referencefiltercallback"},(0,t.yg)("inlineCode",{parentName:"a"},"ReferenceFilterCallback"))),(0,t.yg)("p",null,"Callback that can be used to define a logic to decide whether\na reference should be considered as part of the retainer trace.\nThe callback is called for every reference (edge) in the heap snapshot."),(0,t.yg)("p",null,"For concrete examples, check out ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#leakfilter"},"leakFilter"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edge")," : ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge"))," | the reference (edge)\nthat is considered for calcualting the retainer trace"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"isReferenceUsedByDefault"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"boolean")," | MemLab has its own default\nlogic for whether a reference should be considered as part of the\nretainer trace, if this parameter is true, it means MemLab will\nconsider this reference when calculating the retainer trace."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": the value indicating whether the given reference should be\nconsidered when calculating the retainer trace. Note that when this\ncallback returns true, the reference will only be considered as a candidate\nfor retainer trace, so it may or may not be included in the retainer trace;\nhowever, if this callback returns false, the reference will be excluded."))),(0,t.yg)("p",null,"Note that by excluding a dominator reference of an object (i.e., an edge\nthat must be traveled through to reach the heap object from GC roots),\nthe object will be considered as unreachable in the heap graph; and\ntherefore, the reference and heap object will not be included in the\nretainer trace detection and retainer size calculation."),(0,t.yg)("p",null,"Please also be aware that some edges like self-referencing edges,\nJS engine's internal edges, and hidden edges should not be considered\nas part of the retainer trace. These edges could make the retainer trace\nunncessarily complex and cause confusion. ",(0,t.yg)("inlineCode",{parentName:"p"},"isReferenceUsedByDefault")," will\nbe ",(0,t.yg)("inlineCode",{parentName:"p"},"false")," for these types of edges."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as leak-filter.js\nmodule.exports = {\n retainerReferenceFilter(edge, _snapshot, _isReferenceUsedByDefault) {\n // exclude react fiber references\n if (edge.name_or_index.toString().startsWith('__reactFiber$')) {\n return false;\n }\n // exclude other references here\n // ...\n return true;\n }\n};\n")),(0,t.yg)("p",null,"Use the leak filter definition in command line interface:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab find-leaks --leak-filter \n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab run --scenario --leak-filter \n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L543"},"core/src/lib/Types.ts:543"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8485],{5680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>g});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var s=r.createContext({}),c=function(e){var a=r.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},p=function(e){var a=c(e.components);return r.createElement(s.Provider,{value:a},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},f=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,s=e.parentName,p=o(e,["components","mdxType","originalType","parentName"]),d=c(n),f=t,g=d["".concat(s,".").concat(f)]||d[f]||m[f]||l;return n?r.createElement(g,i(i({ref:a},p),{},{components:n})):r.createElement(g,i({ref:a},p))}));function g(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=f;var o={};for(var s in a)hasOwnProperty.call(a,s)&&(o[s]=a[s]);o.originalType=e,o[d]="string"==typeof e?e:t,i[1]=o;for(var c=2;c{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>c});var r=n(8168),t=(n(6540),n(5680));const l={id:"core_src.ILeakFilter",title:"Interface: ILeakFilter",sidebar_label:"ILeakFilter",custom_edit_url:null},i=void 0,o={unversionedId:"api/interfaces/core_src.ILeakFilter",id:"api/interfaces/core_src.ILeakFilter",title:"Interface: ILeakFilter",description:"The ILeakFilter interface allows you to define a leak detector and",source:"@site/docs/api/interfaces/core_src.ILeakFilter.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.ILeakFilter",permalink:"/memlab/docs/api/interfaces/core_src.ILeakFilter",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.ILeakFilter",title:"Interface: ILeakFilter",sidebar_label:"ILeakFilter",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapStringNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"},next:{title:"IScenario",permalink:"/memlab/docs/api/interfaces/core_src.IScenario"}},s={},c=[{value:"Properties",id:"properties",level:2},{value:' Optional beforeLeakFilter: InitLeakFilterCallback',id:"-optional-beforeleakfilter-initleakfiltercallback",level:3},{value:' Optional leakFilter: LeakFilterCallback',id:"-optional-leakfilter-leakfiltercallback",level:3},{value:' Optional retainerReferenceFilter: ReferenceFilterCallback',id:"-optional-retainerreferencefilter-referencefiltercallback",level:3}],p={toc:c},d="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(d,(0,r.A)({},p,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"The ",(0,t.yg)("inlineCode",{parentName:"p"},"ILeakFilter")," interface allows you to define a leak detector and\ncustomize the leak filtering logic in memlab (instead of using the\nbuilt-in leak filters)."),(0,t.yg)("p",null,"Use the leak filter definition in command line interface to filter\nleaks detected from browser interactions"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab run --scenario --leak-filter \n")),(0,t.yg)("p",null,"If you have already run ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab run")," or ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab snapshot")," which saved\nheap snapshot and other meta data on disk, use the following command\nto filter leaks based on those saved heap snapshots (query the default\ndata location by ",(0,t.yg)("inlineCode",{parentName:"p"},"memlab get-default-work-dir"),")."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab find-leaks --leak-filter \n")),(0,t.yg)("p",null,"Here is an example TypeScript file defining a leak filter.\nThe command line interface only accepts compiled JavaScript file.\nYou can also define the leak filter in JavaScript (without the\ntype annotations."),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import {IHeapNode, IHeapSnapshot, HeapNodeIdSet, utils} from '@memlab/core';\n\nfunction initMap(snapshot: IHeapSnapshot): Record {\n const map = Object.create(null);\n snapshot.nodes.forEach(node => {\n if (node.type !== 'string') {\n return;\n }\n const str = utils.getStringNodeValue(node);\n if (str in map) {\n ++map[str];\n } else {\n map[str] = 1;\n }\n });\n return map;\n}\nconst beforeLeakFilter = (snapshot: IHeapSnapshot, _leakedNodeIds: HeapNodeIdSet): void => {\n map = initMap(snapshot);\n};\n\n// duplicated string with size > 1KB as memory leak\nconst leakFilter = (node: IHeapNode): boolean => {\n if (node.type !== 'string' || node.retainedSize < 1000) {\n return false;\n }\n const str = utils.getStringNodeValue(node);\n return map[str] > 1;\n};\n\nexport default {beforeLeakFilter, leakFilter};\n")),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-optional-beforeleakfilter-initleakfiltercallback"},(0,t.yg)("a",{id:"beforeleakfilter",name:"beforeleakfilter"})," ",(0,t.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,t.yg)("strong",{parentName:"h3"},"beforeLeakFilter"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#initleakfiltercallback"},(0,t.yg)("inlineCode",{parentName:"a"},"InitLeakFilterCallback"))),(0,t.yg)("p",null,"Lifecycle function callback that is invoked initially once before\nthe subsequent ",(0,t.yg)("inlineCode",{parentName:"p"},"leakFilter")," function calls. This callback could\nbe used to initialize some data stores or any one-off\npreprocessings."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,t.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,t.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-javascript"},"module.exports = {\n beforeLeakFilter: (snapshot, leakedNodeIds) {\n // initialize some data stores\n },\n leakFilter(node, snapshot, leakedNodeIds) {\n // use the data stores\n },\n};\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L428"},"core/src/lib/Types.ts:428"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-optional-leakfilter-leakfiltercallback"},(0,t.yg)("a",{id:"leakfilter",name:"leakfilter"})," ",(0,t.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,t.yg)("strong",{parentName:"h3"},"leakFilter"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#leakfiltercallback"},(0,t.yg)("inlineCode",{parentName:"a"},"LeakFilterCallback"))),(0,t.yg)("p",null,"This callback defines how you want to filter out the\nleaked objects. The callback is called for every node (JS heap\nobject in browser) allocated by the ",(0,t.yg)("inlineCode",{parentName:"p"},"action")," callback, but not\nreleased after the ",(0,t.yg)("inlineCode",{parentName:"p"},"back")," callback. Those objects could be caches\nthat are retained in memory on purpose, or they are memory leaks."),(0,t.yg)("p",null,"This optional callback allows you to define your own algorithm\nto cherry pick memory leaks for specific JS program under test."),(0,t.yg)("p",null,"If this optional callback is not defined, memlab will use its\nbuilt-in leak filter, which considers detached DOM elements\nand unmounted Fiber nodes (detached from React Fiber tree) as\nmemory leaks."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode"))," | the heap object\nallocated but not released. This filter callback will be applied\nto each node allocated but not released in the heap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,t.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,t.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": the boolean value indicating whether the given node in\nthe snapshot should be considered as leaked.")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as leak-filter.js\nmodule.exports = {\n leakFilter(node, snapshot, leakedNodeIds) {\n // any unreleased node (JS heap object) with 1MB+\n // retained size is considered a memory leak\n return node.retainedSize > 1000000;\n },\n};\n")),(0,t.yg)("p",null,"Use the leak filter definition in command line interface:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab find-leaks --leak-filter \n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab run --scenario --leak-filter \n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L480"},"core/src/lib/Types.ts:480"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-optional-retainerreferencefilter-referencefiltercallback"},(0,t.yg)("a",{id:"retainerreferencefilter",name:"retainerreferencefilter"})," ",(0,t.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,t.yg)("strong",{parentName:"h3"},"retainerReferenceFilter"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#referencefiltercallback"},(0,t.yg)("inlineCode",{parentName:"a"},"ReferenceFilterCallback"))),(0,t.yg)("p",null,"Callback that can be used to define a logic to decide whether\na reference should be considered as part of the retainer trace.\nThe callback is called for every reference (edge) in the heap snapshot."),(0,t.yg)("p",null,"For concrete examples, check out ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.ILeakFilter#leakfilter"},"leakFilter"),"."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"edge")," : ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge"))," | the reference (edge)\nthat is considered for calcualting the retainer trace"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,t.yg)("code",null,(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"isReferenceUsedByDefault"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"boolean")," | MemLab has its own default\nlogic for whether a reference should be considered as part of the\nretainer trace, if this parameter is true, it means MemLab will\nconsider this reference when calculating the retainer trace."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": the value indicating whether the given reference should be\nconsidered when calculating the retainer trace. Note that when this\ncallback returns true, the reference will only be considered as a candidate\nfor retainer trace, so it may or may not be included in the retainer trace;\nhowever, if this callback returns false, the reference will be excluded."))),(0,t.yg)("p",null,"Note that by excluding a dominator reference of an object (i.e., an edge\nthat must be traveled through to reach the heap object from GC roots),\nthe object will be considered as unreachable in the heap graph; and\ntherefore, the reference and heap object will not be included in the\nretainer trace detection and retainer size calculation."),(0,t.yg)("p",null,"Please also be aware that some edges like self-referencing edges,\nJS engine's internal edges, and hidden edges should not be considered\nas part of the retainer trace. These edges could make the retainer trace\nunncessarily complex and cause confusion. ",(0,t.yg)("inlineCode",{parentName:"p"},"isReferenceUsedByDefault")," will\nbe ",(0,t.yg)("inlineCode",{parentName:"p"},"false")," for these types of edges."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as leak-filter.js\nmodule.exports = {\n retainerReferenceFilter(edge, _snapshot, _isReferenceUsedByDefault) {\n // exclude react fiber references\n if (edge.name_or_index.toString().startsWith('__reactFiber$')) {\n return false;\n }\n // exclude other references here\n // ...\n return true;\n }\n};\n")),(0,t.yg)("p",null,"Use the leak filter definition in command line interface:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab find-leaks --leak-filter \n")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-bash"},"memlab run --scenario --leak-filter \n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L543"},"core/src/lib/Types.ts:543"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/6b5d7254.5ae8e530.js b/assets/js/6b5d7254.64aef8a7.js similarity index 97% rename from assets/js/6b5d7254.5ae8e530.js rename to assets/js/6b5d7254.64aef8a7.js index b8982443f..5f6e9d608 100644 --- a/assets/js/6b5d7254.5ae8e530.js +++ b/assets/js/6b5d7254.64aef8a7.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9548],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var p=r.createContext({}),s=function(e){var a=r.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},c=function(e){var a=s(e.components);return r.createElement(p.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},d=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,p=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),g=s(n),d=t,y=g["".concat(p,".").concat(d)]||g[d]||m[d]||l;return n?r.createElement(y,i(i({ref:a},c),{},{components:n})):r.createElement(y,i({ref:a},c))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=d;var o={};for(var p in a)hasOwnProperty.call(a,p)&&(o[p]=a[p]);o.originalType=e,o[g]="string"==typeof e?e:t,i[1]=o;for(var s=2;s{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>s});var r=n(8168),t=(n(6540),n(5680));const l={id:"core_src.IHeapEdges",title:"Interface: IHeapEdges",sidebar_label:"IHeapEdges",custom_edit_url:null},i=void 0,o={unversionedId:"api/interfaces/core_src.IHeapEdges",id:"api/interfaces/core_src.IHeapEdges",title:"Interface: IHeapEdges",description:"A pseudo array containing all heap graph edges (references to heap objects",source:"@site/docs/api/interfaces/core_src.IHeapEdges.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapEdges",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdges",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapEdges",title:"Interface: IHeapEdges",sidebar_label:"IHeapEdges",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapEdge",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},next:{title:"IHeapLocation",permalink:"/memlab/docs/api/interfaces/core_src.IHeapLocation"}},p={},s=[{value:"Properties",id:"properties",level:2},{value:' length: number',id:"-length-number",level:3},{value:"Methods",id:"methods",level:2},{value:'forEach(callback)',id:"foreachcallback",level:3},{value:'get(index)',id:"getindex",level:3}],c={toc:s},g="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(g,(0,r.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"A pseudo array containing all heap graph edges (references to heap objects\nin heap). A JS heap could contain millions of references, so memlab uses\na pseudo array as the collection of all the heap edges. The pseudo\narray provides API to query and traverse all heap references."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," modifying this pseudo array is not recommended"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapEdges} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n const edges: IHeapEdges = heap.edges;\n edges.length;\n edges.get(0);\n edges.forEach((edge, i) => {\n if (stopIteration) {\n return false;\n }\n });\n})();\n")),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-length-number"},(0,t.yg)("a",{id:"length",name:"length"})," ",(0,t.yg)("strong",{parentName:"h3"},"length"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of edges in heap graph (or JS references in heap\nsnapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1747"},"core/src/lib/Types.ts:1747"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"foreachcallback"},(0,t.yg)("a",{id:"foreach"}),(0,t.yg)("strong",{parentName:"h3"},"forEach"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"Iterate over all array elements and apply the callback\nto each element in ascending order of element index."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"edge"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),", ",(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number"),") => ",(0,t.yg)("inlineCode",{parentName:"li"},"boolean")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"void")," | the callback does not need to return any value, if the callback returns ",(0,t.yg)("inlineCode",{parentName:"li"},"false")," when iterating on element at index ",(0,t.yg)("inlineCode",{parentName:"li"},"i"),", then all elements after ",(0,t.yg)("inlineCode",{parentName:"li"},"i")," won't be iterated."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1763"},"core/src/lib/Types.ts:1763"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getindex"},(0,t.yg)("a",{id:"get"}),(0,t.yg)("strong",{parentName:"h3"},"get"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"index"),")"),(0,t.yg)("p",null,"get an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge")," element at the specified index"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the index of an element in the pseudo array, the index ranges from 0 to array length - 1. Notice that this is not the heap node id."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | When 0 <= ",(0,t.yg)("inlineCode",{parentName:"p"},"index")," < array.length, this API returns the element\nat the specified index, otherwise it returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null"),".")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1755"},"core/src/lib/Types.ts:1755"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9548],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var p=r.createContext({}),s=function(e){var a=r.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},c=function(e){var a=s(e.components);return r.createElement(p.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},d=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,p=e.parentName,c=o(e,["components","mdxType","originalType","parentName"]),g=s(n),d=t,y=g["".concat(p,".").concat(d)]||g[d]||m[d]||l;return n?r.createElement(y,i(i({ref:a},c),{},{components:n})):r.createElement(y,i({ref:a},c))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=d;var o={};for(var p in a)hasOwnProperty.call(a,p)&&(o[p]=a[p]);o.originalType=e,o[g]="string"==typeof e?e:t,i[1]=o;for(var s=2;s{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>s});var r=n(8168),t=(n(6540),n(5680));const l={id:"core_src.IHeapEdges",title:"Interface: IHeapEdges",sidebar_label:"IHeapEdges",custom_edit_url:null},i=void 0,o={unversionedId:"api/interfaces/core_src.IHeapEdges",id:"api/interfaces/core_src.IHeapEdges",title:"Interface: IHeapEdges",description:"A pseudo array containing all heap graph edges (references to heap objects",source:"@site/docs/api/interfaces/core_src.IHeapEdges.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapEdges",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdges",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapEdges",title:"Interface: IHeapEdges",sidebar_label:"IHeapEdges",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapEdge",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},next:{title:"IHeapLocation",permalink:"/memlab/docs/api/interfaces/core_src.IHeapLocation"}},p={},s=[{value:"Properties",id:"properties",level:2},{value:' length: number',id:"-length-number",level:3},{value:"Methods",id:"methods",level:2},{value:'forEach(callback)',id:"foreachcallback",level:3},{value:'get(index)',id:"getindex",level:3}],c={toc:s},g="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(g,(0,r.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"A pseudo array containing all heap graph edges (references to heap objects\nin heap). A JS heap could contain millions of references, so memlab uses\na pseudo array as the collection of all the heap edges. The pseudo\narray provides API to query and traverse all heap references."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," modifying this pseudo array is not recommended"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapEdges} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n const edges: IHeapEdges = heap.edges;\n edges.length;\n edges.get(0);\n edges.forEach((edge, i) => {\n if (stopIteration) {\n return false;\n }\n });\n})();\n")),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-length-number"},(0,t.yg)("a",{id:"length",name:"length"})," ",(0,t.yg)("strong",{parentName:"h3"},"length"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of edges in heap graph (or JS references in heap\nsnapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1747"},"core/src/lib/Types.ts:1747"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"foreachcallback"},(0,t.yg)("a",{id:"foreach"}),(0,t.yg)("strong",{parentName:"h3"},"forEach"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"Iterate over all array elements and apply the callback\nto each element in ascending order of element index."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"edge"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),", ",(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number"),") => ",(0,t.yg)("inlineCode",{parentName:"li"},"boolean")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"void")," | the callback does not need to return any value, if the callback returns ",(0,t.yg)("inlineCode",{parentName:"li"},"false")," when iterating on element at index ",(0,t.yg)("inlineCode",{parentName:"li"},"i"),", then all elements after ",(0,t.yg)("inlineCode",{parentName:"li"},"i")," won't be iterated."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1763"},"core/src/lib/Types.ts:1763"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getindex"},(0,t.yg)("a",{id:"get"}),(0,t.yg)("strong",{parentName:"h3"},"get"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"index"),")"),(0,t.yg)("p",null,"get an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge")," element at the specified index"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the index of an element in the pseudo array, the index ranges from 0 to array length - 1. Notice that this is not the heap node id."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapEdge")),">"," | When 0 <= ",(0,t.yg)("inlineCode",{parentName:"p"},"index")," < array.length, this API returns the element\nat the specified index, otherwise it returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null"),".")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1755"},"core/src/lib/Types.ts:1755"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/72eddb53.31eb1560.js b/assets/js/72eddb53.a0bea85c.js similarity index 98% rename from assets/js/72eddb53.31eb1560.js rename to assets/js/72eddb53.a0bea85c.js index d4e244318..6d276adc0 100644 --- a/assets/js/72eddb53.31eb1560.js +++ b/assets/js/72eddb53.a0bea85c.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1473],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>g});var t=n(6540);function l(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function s(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(l[n]=e[n]);return l}(e,a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},c=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},y="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,l=e.mdxType,s=e.originalType,o=e.parentName,c=r(e,["components","mdxType","originalType","parentName"]),y=p(n),m=l,g=y["".concat(o,".").concat(m)]||y[m]||u[m]||s;return n?t.createElement(g,i(i({ref:a},c),{},{components:n})):t.createElement(g,i({ref:a},c))}));function g(e,a){var n=arguments,l=a&&a.mdxType;if("string"==typeof e||l){var s=n.length,i=new Array(s);i[0]=m;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[y]="string"==typeof e?e:l,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>r,toc:()=>p});var t=n(8168),l=(n(6540),n(5680));const s={id:"heap_analysis_src.ObjectShallowAnalysis",title:"Class: ObjectShallowAnalysis",sidebar_label:"ObjectShallowAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectShallowAnalysis",id:"api/classes/heap_analysis_src.ObjectShallowAnalysis",title:"Class: ObjectShallowAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectShallowAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectShallowAnalysis",title:"Class: ObjectShallowAnalysis",sidebar_label:"ObjectShallowAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectFanoutAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"},next:{title:"ObjectShapeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectShallowAnalysis()',id:"new-objectshallowanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getTopDuplicatedObjectInCount()',id:"gettopduplicatedobjectincount",level:3}],c={toc:p},y="wrapper";function u(e){let{components:a,...n}=e;return(0,l.yg)(y,(0,t.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,l.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,l.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,l.yg)("p",{parentName:"li"},"\u21b3 ",(0,l.yg)("strong",{parentName:"p"},(0,l.yg)("inlineCode",{parentName:"strong"},"ObjectShallowAnalysis"))))),(0,l.yg)("h2",{id:"constructors"},"Constructors"),(0,l.yg)("h3",{id:"new-objectshallowanalysis"},(0,l.yg)("a",{id:"new objectshallowanalysis"}),(0,l.yg)("strong",{parentName:"h3"},"new ObjectShallowAnalysis"),"()"),(0,l.yg)("h2",{id:"methods"},"Methods"),(0,l.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,l.yg)("a",{id:"analyzesnapshotfromfile"}),(0,l.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,l.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,l.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,l.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Parameters"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,l.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,l.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,l.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Example"),":")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,l.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getcommandname"},(0,l.yg)("a",{id:"getcommandname"}),(0,l.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,l.yg)("p",null,"get CLI command name for this memory analysis;\nuse it with ",(0,l.yg)("inlineCode",{parentName:"p"},"memlab analyze ")," in CLI"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"p"},"string")," | command name")),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Source"),":"),(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ObjectShallowAnalysis.ts#L65"},"heap-analysis/src/plugins/ObjectShallowAnalysis.ts:65"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"gettopduplicatedobjectincount"},(0,l.yg)("a",{id:"gettopduplicatedobjectincount"}),(0,l.yg)("strong",{parentName:"h3"},"getTopDuplicatedObjectInCount"),"()"),(0,l.yg)("p",null,"get the top duplicated object in terms of duplicated object count"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"p"},"ObjectRecord"),"[] | an array of the top-duplicated objects' information")),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Source"),":"),(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ObjectShallowAnalysis.ts#L108"},"heap-analysis/src/plugins/ObjectShallowAnalysis.ts:108"))))))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1473],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>g});var t=n(6540);function l(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function s(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(l[n]=e[n]);return l}(e,a);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},c=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},y="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,l=e.mdxType,s=e.originalType,o=e.parentName,c=r(e,["components","mdxType","originalType","parentName"]),y=p(n),m=l,g=y["".concat(o,".").concat(m)]||y[m]||u[m]||s;return n?t.createElement(g,i(i({ref:a},c),{},{components:n})):t.createElement(g,i({ref:a},c))}));function g(e,a){var n=arguments,l=a&&a.mdxType;if("string"==typeof e||l){var s=n.length,i=new Array(s);i[0]=m;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[y]="string"==typeof e?e:l,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>r,toc:()=>p});var t=n(8168),l=(n(6540),n(5680));const s={id:"heap_analysis_src.ObjectShallowAnalysis",title:"Class: ObjectShallowAnalysis",sidebar_label:"ObjectShallowAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectShallowAnalysis",id:"api/classes/heap_analysis_src.ObjectShallowAnalysis",title:"Class: ObjectShallowAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectShallowAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectShallowAnalysis",title:"Class: ObjectShallowAnalysis",sidebar_label:"ObjectShallowAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectFanoutAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis"},next:{title:"ObjectShapeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectShallowAnalysis()',id:"new-objectshallowanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getTopDuplicatedObjectInCount()',id:"gettopduplicatedobjectincount",level:3}],c={toc:p},y="wrapper";function u(e){let{components:a,...n}=e;return(0,l.yg)(y,(0,t.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,l.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,l.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,l.yg)("p",{parentName:"li"},"\u21b3 ",(0,l.yg)("strong",{parentName:"p"},(0,l.yg)("inlineCode",{parentName:"strong"},"ObjectShallowAnalysis"))))),(0,l.yg)("h2",{id:"constructors"},"Constructors"),(0,l.yg)("h3",{id:"new-objectshallowanalysis"},(0,l.yg)("a",{id:"new objectshallowanalysis"}),(0,l.yg)("strong",{parentName:"h3"},"new ObjectShallowAnalysis"),"()"),(0,l.yg)("h2",{id:"methods"},"Methods"),(0,l.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,l.yg)("a",{id:"analyzesnapshotfromfile"}),(0,l.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,l.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,l.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,l.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Parameters"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,l.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,l.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,l.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,l.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Example"),":")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,l.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("strong",{parentName:"li"},"Source"),":",(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getcommandname"},(0,l.yg)("a",{id:"getcommandname"}),(0,l.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,l.yg)("p",null,"get CLI command name for this memory analysis;\nuse it with ",(0,l.yg)("inlineCode",{parentName:"p"},"memlab analyze ")," in CLI"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"p"},"string")," | command name")),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Source"),":"),(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ObjectShallowAnalysis.ts#L65"},"heap-analysis/src/plugins/ObjectShallowAnalysis.ts:65"))))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"gettopduplicatedobjectincount"},(0,l.yg)("a",{id:"gettopduplicatedobjectincount"}),(0,l.yg)("strong",{parentName:"h3"},"getTopDuplicatedObjectInCount"),"()"),(0,l.yg)("p",null,"get the top duplicated object in terms of duplicated object count"),(0,l.yg)("ul",null,(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Returns"),": ",(0,l.yg)("inlineCode",{parentName:"p"},"ObjectRecord"),"[] | an array of the top-duplicated objects' information")),(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("p",{parentName:"li"},(0,l.yg)("strong",{parentName:"p"},"Source"),":"),(0,l.yg)("ul",{parentName:"li"},(0,l.yg)("li",{parentName:"ul"},(0,l.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ObjectShallowAnalysis.ts#L108"},"heap-analysis/src/plugins/ObjectShallowAnalysis.ts:108"))))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/8b21a35a.e54ac600.js b/assets/js/8b21a35a.cae5f0be.js similarity index 95% rename from assets/js/8b21a35a.e54ac600.js rename to assets/js/8b21a35a.cae5f0be.js index 8957534a0..d9ddc815c 100644 --- a/assets/js/8b21a35a.e54ac600.js +++ b/assets/js/8b21a35a.cae5f0be.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[6640],{5680:(e,a,n)=>{n.d(a,{xA:()=>m,yg:()=>u});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),p=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},m=function(e){var a=p(e.components);return t.createElement(s.Provider,{value:a},e.children)},g="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},y=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),g=p(n),y=r,u=g["".concat(s,".").concat(y)]||g[y]||d[y]||i;return n?t.createElement(u,l(l({ref:a},m),{},{components:n})):t.createElement(u,l({ref:a},m))}));function u(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=y;var o={};for(var s in a)hasOwnProperty.call(a,s)&&(o[s]=a[s]);o.originalType=e,o[g]="string"==typeof e?e:r,l[1]=o;for(var p=2;p{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>l,default:()=>d,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var t=n(8168),r=(n(6540),n(5680));const i={id:"api_src",title:"Package: @memlab/api",sidebar_label:"api/src",sidebar_position:0,custom_edit_url:null},l=void 0,o={unversionedId:"api/modules/api_src",id:"api/modules/api_src",title:"Package: @memlab/api",description:"Enumerations",source:"@site/docs/api/modules/api_src.md",sourceDirName:"api/modules",slug:"/api/modules/api_src",permalink:"/memlab/docs/api/modules/api_src",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"api_src",title:"Package: @memlab/api",sidebar_label:"api/src",sidebar_position:0,custom_edit_url:null},sidebar:"sidebar",previous:{title:"Table of contents",permalink:"/memlab/docs/api/"},next:{title:"core/src",permalink:"/memlab/docs/api/modules/core_src"}},s={},p=[{value:"Enumerations",id:"enumerations",level:2},{value:"Classes",id:"classes",level:2},{value:"Type Aliases",id:"type-aliases",level:2},{value:' RunOptions: Object',id:"-runoptions-object",level:3},{value:' RunResult: Object',id:"-runresult-object",level:3},{value:"Functions",id:"functions",level:2},{value:'analyze(runResult, heapAnalyzer, args?)',id:"analyzerunresult-heapanalyzer-args",level:3},{value:'findLeaks(runResult, options?)',id:"findleaksrunresult-options",level:3},{value:'findLeaksBySnapshotFilePaths(baselineSnapshot, targetSnapshot, finalSnapshot, options?)',id:"findleaksbysnapshotfilepathsbaselinesnapshot-targetsnapshot-finalsnapshot-options",level:3},{value:'run(options?)',id:"runoptions",level:3},{value:'takeSnapshots(options?)',id:"takesnapshotsoptions",level:3},{value:'warmupAndTakeSnapshots(options?)',id:"warmupandtakesnapshotsoptions",level:3}],m={toc:p},g="wrapper";function d(e){let{components:a,...n}=e;return(0,r.yg)(g,(0,t.A)({},m,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("h2",{id:"enumerations"},"Enumerations"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"))),(0,r.yg)("h2",{id:"classes"},"Classes"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.SnapshotResultReader"},"SnapshotResultReader"))),(0,r.yg)("h2",{id:"type-aliases"},"Type Aliases"),(0,r.yg)("h3",{id:"-runoptions-object"},(0,r.yg)("a",{id:"runoptions",name:"runoptions"})," ",(0,r.yg)("strong",{parentName:"h3"},"RunOptions"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"Options for configuring browser interaction run, all fields are optional"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"chromiumBinary?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"if not specified, memlab will use the Chromium binary installed by Puppeteer. Use this option to specify a different binary if Puppeteer does not install the Chromium binary correctly (e.g., in a environtment Docker) or when you may want to use a different version of Chromium binary.")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"consoleMode?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},(0,r.yg)("inlineCode",{parentName:"a"},"ConsoleMode"))),(0,r.yg)("td",{parentName:"tr",align:"left"},"specifying the terminal output mode, default is ",(0,r.yg)("inlineCode",{parentName:"td"},"default"),". For more details. please check out ",(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"))),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"cookiesFile?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"the absolute path of cookies file")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"evalInBrowserAfterInitLoad?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"AnyFunction")),(0,r.yg)("td",{parentName:"tr",align:"left"},"function to be evaluated in browser context after the web page initial load. Note that this function is defined in node.js context but it will be evaluated in browser context so the function should not use any closure variables outside of the browser context.")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"scenario?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"IScenario")),(0,r.yg)("td",{parentName:"tr",align:"left"},"test scenario specifying how to interact with browser (for more details view ",(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/interfaces/core_src.IScenario"},"IScenario"),")")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"skipWarmup?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"boolean")),(0,r.yg)("td",{parentName:"tr",align:"left"},"skip the initial page loading warmup for the web application being tested")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"snapshotForEachStep?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"boolean")),(0,r.yg)("td",{parentName:"tr",align:"left"},"if true, take heap snapshot for each interaction step, by default this is false, which means memlab will decide which steps it will take heap snapshots")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"webWorker?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"Optional"),"<",(0,r.yg)("inlineCode",{parentName:"td"},"string"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"if this field is provided, it specifies the web worker as the target for heap analysis. For example ",(0,r.yg)("inlineCode",{parentName:"td"},"{webWorker: null}")," means analyzing the heap of the first web worker found. ",(0,r.yg)("inlineCode",{parentName:"td"},"{webWorker: 'workerTitle'}")," means analyzing the heap of the web worker with name: ",(0,r.yg)("inlineCode",{parentName:"td"},"'workerTitle'"),".")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"workDir?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"specify the working directory where you want memlab to dump heap snapshots and other meta data of the test run. If no working directory is provided, memlab will generate a random temp directory under the operating system's default directory for temporary files. Note: It's the caller's responsibility to make sure the specified working directory exists.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L47"},"api/src/API.ts:47"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-runresult-object"},(0,r.yg)("a",{id:"runresult",name:"runresult"})," ",(0,r.yg)("strong",{parentName:"h3"},"RunResult"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"A data structure holding the result of the ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#run"},"run")," API call."),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"leaks")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"ISerializedInfo"),"[]"),(0,r.yg)("td",{parentName:"tr",align:"left"},"leak traces detected and clustered from the browser interaction")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"runResult")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader"))),(0,r.yg)("td",{parentName:"tr",align:"left"},"a utility for reading browser interaction results from disk")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L108"},"api/src/API.ts:108"))))),(0,r.yg)("h2",{id:"functions"},"Functions"),(0,r.yg)("h3",{id:"analyzerunresult-heapanalyzer-args"},(0,r.yg)("a",{id:"analyze"}),(0,r.yg)("strong",{parentName:"h3"},"analyze"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"runResult"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"heapAnalyzer"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"args?"),")"),(0,r.yg)("p",null,"This API analyzes heap snapshot(s) with a specified heap analysis.\nThis is equivalent to ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab analyze")," in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"runResult"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"default")," | return value of a browser interaction run"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"heapAnalyzer"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," | instance of a heap analysis"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"args"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"ParsedArgs")," | other CLI arguments that needs to be passed to the heap analysis"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"li"},"void"),">"," | each analysis may have a different return type, please check out\nthe type definition or the documentation for the ",(0,r.yg)("inlineCode",{parentName:"li"},"process")," method of the\nanalysis class you are using for ",(0,r.yg)("inlineCode",{parentName:"li"},"heapAnalyzer"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {analyze, takeSnapshots, StringAnalysis} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await takeSnapshots({scenario});\n const analysis = new StringAnalysis();\n await analyze(result, analysis);\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L328"},"api/src/API.ts:328"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"findleaksrunresult-options"},(0,r.yg)("a",{id:"findleaks"}),(0,r.yg)("strong",{parentName:"h3"},"findLeaks"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"runResult"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API finds memory leaks by analyzing heap snapshot(s).\nThis is equivalent to ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab find-leaks")," in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"runResult"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"default")," | return value of a browser interaction run"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Object")," | configure memory leak detection run"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options.consoleMode?"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},(0,r.yg)("inlineCode",{parentName:"a"},"ConsoleMode"))," | specify the terminal output mode (see ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"),")"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"li"},"ISerializedInfo"),"[]",">"," | leak traces detected and clustered from the browser interaction"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {findLeaks, takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await takeSnapshots({scenario, consoleMode: 'SILENT'});\n const leaks = findLeaks(result, {consoleMode: 'CONTINUOUS_TEST'});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L256"},"api/src/API.ts:256"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"findleaksbysnapshotfilepathsbaselinesnapshot-targetsnapshot-finalsnapshot-options"},(0,r.yg)("a",{id:"findleaksbysnapshotfilepaths"}),(0,r.yg)("strong",{parentName:"h3"},"findLeaksBySnapshotFilePaths"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"baselineSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"targetSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"finalSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API finds memory leaks by analyzing specified heap snapshots.\nThis is equivalent to ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab find-leaks")," with\nthe ",(0,r.yg)("inlineCode",{parentName:"p"},"--baseline"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"--target"),", and ",(0,r.yg)("inlineCode",{parentName:"p"},"--final")," flags in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"baselineSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the file path of the baseline heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"targetSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the file path of the target heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"finalSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the file path of the final heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Object")," | optionally, you can specify a mode for heap analysis"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options.consoleMode?"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},(0,r.yg)("inlineCode",{parentName:"a"},"ConsoleMode"))," | specify the terminal output mode (see ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"),")"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options.workDir?"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | specify a working directory (other than the default one)"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"p"},"ISerializedInfo"),"[]",">"," | leak traces detected and clustered from the browser interaction")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L284"},"api/src/API.ts:284"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"runoptions"},(0,r.yg)("a",{id:"run"}),(0,r.yg)("strong",{parentName:"h3"},"run"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API runs browser interaction and find memory leaks triggered in browser\nThis is equivalent to running ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab run")," in CLI.\nThis is also equivalent to warm up, and call ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#takesnapshots"},"takeSnapshots"),"\nand ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#findleaks"},"findLeaks"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runoptions"},(0,r.yg)("inlineCode",{parentName:"a"},"RunOptions"))))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runresult"},(0,r.yg)("inlineCode",{parentName:"a"},"RunResult")),">"," | memory leaks detected and a utility reading browser\ninteraction results from disk"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {run} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const {leaks} = await run({scenario});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L188"},"api/src/API.ts:188"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"takesnapshotsoptions"},(0,r.yg)("a",{id:"takesnapshots"}),(0,r.yg)("strong",{parentName:"h3"},"takeSnapshots"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API runs E2E interaction and takes heap snapshots.\nThis is equivalent to running ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab snapshot")," in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runoptions"},(0,r.yg)("inlineCode",{parentName:"a"},"RunOptions"))," | configure browser interaction run"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader")),">"," | a utility reading browser interaction results from disk"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await takeSnapshots({scenario});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L221"},"api/src/API.ts:221"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"warmupandtakesnapshotsoptions"},(0,r.yg)("a",{id:"warmupandtakesnapshots"}),(0,r.yg)("strong",{parentName:"h3"},"warmupAndTakeSnapshots"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API warms up web server, runs E2E interaction, and takes heap snapshots.\nThis is equivalent to running ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab warmup-and-snapshot")," in CLI.\nThis is also equivalent to warm up and call ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#takesnapshots"},"takeSnapshots"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runoptions"},(0,r.yg)("inlineCode",{parentName:"a"},"RunOptions"))," | configure browser interaction run"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader")),">"," | browser interaction results"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {warmupAndTakeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await warmupAndTakeSnapshots({scenario});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/API.ts#L151"},"api/src/API.ts:151"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[6640],{5680:(e,a,n)=>{n.d(a,{xA:()=>m,yg:()=>u});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function i(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),p=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},m=function(e){var a=p(e.components);return t.createElement(s.Provider,{value:a},e.children)},g="mdxType",y={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},d=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,i=e.originalType,s=e.parentName,m=o(e,["components","mdxType","originalType","parentName"]),g=p(n),d=r,u=g["".concat(s,".").concat(d)]||g[d]||y[d]||i;return n?t.createElement(u,l(l({ref:a},m),{},{components:n})):t.createElement(u,l({ref:a},m))}));function u(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var i=n.length,l=new Array(i);l[0]=d;var o={};for(var s in a)hasOwnProperty.call(a,s)&&(o[s]=a[s]);o.originalType=e,o[g]="string"==typeof e?e:r,l[1]=o;for(var p=2;p{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>l,default:()=>y,frontMatter:()=>i,metadata:()=>o,toc:()=>p});var t=n(8168),r=(n(6540),n(5680));const i={id:"api_src",title:"Package: @memlab/api",sidebar_label:"api/src",sidebar_position:0,custom_edit_url:null},l=void 0,o={unversionedId:"api/modules/api_src",id:"api/modules/api_src",title:"Package: @memlab/api",description:"Enumerations",source:"@site/docs/api/modules/api_src.md",sourceDirName:"api/modules",slug:"/api/modules/api_src",permalink:"/memlab/docs/api/modules/api_src",draft:!1,editUrl:null,tags:[],version:"current",sidebarPosition:0,frontMatter:{id:"api_src",title:"Package: @memlab/api",sidebar_label:"api/src",sidebar_position:0,custom_edit_url:null},sidebar:"sidebar",previous:{title:"Table of contents",permalink:"/memlab/docs/api/"},next:{title:"core/src",permalink:"/memlab/docs/api/modules/core_src"}},s={},p=[{value:"Enumerations",id:"enumerations",level:2},{value:"Classes",id:"classes",level:2},{value:"Type Aliases",id:"type-aliases",level:2},{value:' RunOptions: Object',id:"-runoptions-object",level:3},{value:' RunResult: Object',id:"-runresult-object",level:3},{value:"Functions",id:"functions",level:2},{value:'analyze(runResult, heapAnalyzer, args?)',id:"analyzerunresult-heapanalyzer-args",level:3},{value:'findLeaks(runResult, options?)',id:"findleaksrunresult-options",level:3},{value:'findLeaksBySnapshotFilePaths(baselineSnapshot, targetSnapshot, finalSnapshot, options?)',id:"findleaksbysnapshotfilepathsbaselinesnapshot-targetsnapshot-finalsnapshot-options",level:3},{value:'run(options?)',id:"runoptions",level:3},{value:'takeSnapshots(options?)',id:"takesnapshotsoptions",level:3},{value:'warmupAndTakeSnapshots(options?)',id:"warmupandtakesnapshotsoptions",level:3}],m={toc:p},g="wrapper";function y(e){let{components:a,...n}=e;return(0,r.yg)(g,(0,t.A)({},m,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("h2",{id:"enumerations"},"Enumerations"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"))),(0,r.yg)("h2",{id:"classes"},"Classes"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},"BrowserInteractionResultReader")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.SnapshotResultReader"},"SnapshotResultReader"))),(0,r.yg)("h2",{id:"type-aliases"},"Type Aliases"),(0,r.yg)("h3",{id:"-runoptions-object"},(0,r.yg)("a",{id:"runoptions",name:"runoptions"})," ",(0,r.yg)("strong",{parentName:"h3"},"RunOptions"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"Options for configuring browser interaction run, all fields are optional"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"chromiumBinary?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"if not specified, memlab will use the Chromium binary installed by Puppeteer. Use this option to specify a different binary if Puppeteer does not install the Chromium binary correctly (e.g., in a environtment Docker) or when you may want to use a different version of Chromium binary.")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"consoleMode?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},(0,r.yg)("inlineCode",{parentName:"a"},"ConsoleMode"))),(0,r.yg)("td",{parentName:"tr",align:"left"},"specifying the terminal output mode, default is ",(0,r.yg)("inlineCode",{parentName:"td"},"default"),". For more details. please check out ",(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"))),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"cookiesFile?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"the absolute path of cookies file")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"evalInBrowserAfterInitLoad?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"AnyFunction")),(0,r.yg)("td",{parentName:"tr",align:"left"},"function to be evaluated in browser context after the web page initial load. Note that this function is defined in node.js context but it will be evaluated in browser context so the function should not use any closure variables outside of the browser context.")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"scenario?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"IScenario")),(0,r.yg)("td",{parentName:"tr",align:"left"},"test scenario specifying how to interact with browser (for more details view ",(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/interfaces/core_src.IScenario"},"IScenario"),")")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"skipWarmup?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"boolean")),(0,r.yg)("td",{parentName:"tr",align:"left"},"skip the initial page loading warmup for the web application being tested")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"snapshotForEachStep?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"boolean")),(0,r.yg)("td",{parentName:"tr",align:"left"},"if true, take heap snapshot for each interaction step, by default this is false, which means memlab will decide which steps it will take heap snapshots")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"webWorker?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"Optional"),"<",(0,r.yg)("inlineCode",{parentName:"td"},"string"),">"),(0,r.yg)("td",{parentName:"tr",align:"left"},"if this field is provided, it specifies the web worker as the target for heap analysis. For example ",(0,r.yg)("inlineCode",{parentName:"td"},"{webWorker: null}")," means analyzing the heap of the first web worker found. ",(0,r.yg)("inlineCode",{parentName:"td"},"{webWorker: 'workerTitle'}")," means analyzing the heap of the web worker with name: ",(0,r.yg)("inlineCode",{parentName:"td"},"'workerTitle'"),".")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"workDir?")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"string")),(0,r.yg)("td",{parentName:"tr",align:"left"},"specify the working directory where you want memlab to dump heap snapshots and other meta data of the test run. If no working directory is provided, memlab will generate a random temp directory under the operating system's default directory for temporary files. Note: It's the caller's responsibility to make sure the specified working directory exists.")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L47"},"api/src/API.ts:47"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-runresult-object"},(0,r.yg)("a",{id:"runresult",name:"runresult"})," ",(0,r.yg)("strong",{parentName:"h3"},"RunResult"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"Object")),(0,r.yg)("p",null,"A data structure holding the result of the ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#run"},"run")," API call."),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:"left"},"Name"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Type"),(0,r.yg)("th",{parentName:"tr",align:"left"},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"leaks")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"ISerializedInfo"),"[]"),(0,r.yg)("td",{parentName:"tr",align:"left"},"leak traces detected and clustered from the browser interaction")),(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("inlineCode",{parentName:"td"},"runResult")),(0,r.yg)("td",{parentName:"tr",align:"left"},(0,r.yg)("a",{parentName:"td",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader"))),(0,r.yg)("td",{parentName:"tr",align:"left"},"a utility for reading browser interaction results from disk")))),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L108"},"api/src/API.ts:108"))))),(0,r.yg)("h2",{id:"functions"},"Functions"),(0,r.yg)("h3",{id:"analyzerunresult-heapanalyzer-args"},(0,r.yg)("a",{id:"analyze"}),(0,r.yg)("strong",{parentName:"h3"},"analyze"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"runResult"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"heapAnalyzer"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"args?"),")"),(0,r.yg)("p",null,"This API analyzes heap snapshot(s) with a specified heap analysis.\nThis is equivalent to ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab analyze")," in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"runResult"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"default")," | return value of a browser interaction run"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"heapAnalyzer"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"BaseAnalysis")," | instance of a heap analysis"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"args"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"ParsedArgs")," | other CLI arguments that needs to be passed to the heap analysis"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"li"},"void"),">"," | each analysis may have a different return type, please check out\nthe type definition or the documentation for the ",(0,r.yg)("inlineCode",{parentName:"li"},"process")," method of the\nanalysis class you are using for ",(0,r.yg)("inlineCode",{parentName:"li"},"heapAnalyzer"),"."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {analyze, takeSnapshots, StringAnalysis} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await takeSnapshots({scenario});\n const analysis = new StringAnalysis();\n await analyze(result, analysis);\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L328"},"api/src/API.ts:328"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"findleaksrunresult-options"},(0,r.yg)("a",{id:"findleaks"}),(0,r.yg)("strong",{parentName:"h3"},"findLeaks"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"runResult"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API finds memory leaks by analyzing heap snapshot(s).\nThis is equivalent to ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab find-leaks")," in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"runResult"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"default")," | return value of a browser interaction run"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Object")," | configure memory leak detection run"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options.consoleMode?"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},(0,r.yg)("inlineCode",{parentName:"a"},"ConsoleMode"))," | specify the terminal output mode (see ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"),")"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"li"},"ISerializedInfo"),"[]",">"," | leak traces detected and clustered from the browser interaction"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {findLeaks, takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await takeSnapshots({scenario, consoleMode: 'SILENT'});\n const leaks = findLeaks(result, {consoleMode: 'CONTINUOUS_TEST'});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L256"},"api/src/API.ts:256"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"findleaksbysnapshotfilepathsbaselinesnapshot-targetsnapshot-finalsnapshot-options"},(0,r.yg)("a",{id:"findleaksbysnapshotfilepaths"}),(0,r.yg)("strong",{parentName:"h3"},"findLeaksBySnapshotFilePaths"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"baselineSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"targetSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"finalSnapshot"),", ",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API finds memory leaks by analyzing specified heap snapshots.\nThis is equivalent to ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab find-leaks")," with\nthe ",(0,r.yg)("inlineCode",{parentName:"p"},"--baseline"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"--target"),", and ",(0,r.yg)("inlineCode",{parentName:"p"},"--final")," flags in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"baselineSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the file path of the baseline heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"targetSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the file path of the target heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"finalSnapshot"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the file path of the final heap snapshot"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Object")," | optionally, you can specify a mode for heap analysis"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options.consoleMode?"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},(0,r.yg)("inlineCode",{parentName:"a"},"ConsoleMode"))," | specify the terminal output mode (see ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/enums/api_src.ConsoleMode"},"ConsoleMode"),")"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options.workDir?"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | specify a working directory (other than the default one)"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Promise"),"<",(0,r.yg)("inlineCode",{parentName:"p"},"ISerializedInfo"),"[]",">"," | leak traces detected and clustered from the browser interaction")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Source"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L284"},"api/src/API.ts:284"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"runoptions"},(0,r.yg)("a",{id:"run"}),(0,r.yg)("strong",{parentName:"h3"},"run"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API runs browser interaction and find memory leaks triggered in browser\nThis is equivalent to running ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab run")," in CLI.\nThis is also equivalent to warm up, and call ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#takesnapshots"},"takeSnapshots"),"\nand ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#findleaks"},"findLeaks"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runoptions"},(0,r.yg)("inlineCode",{parentName:"a"},"RunOptions"))))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runresult"},(0,r.yg)("inlineCode",{parentName:"a"},"RunResult")),">"," | memory leaks detected and a utility reading browser\ninteraction results from disk"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {run} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const {leaks} = await run({scenario});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L188"},"api/src/API.ts:188"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"takesnapshotsoptions"},(0,r.yg)("a",{id:"takesnapshots"}),(0,r.yg)("strong",{parentName:"h3"},"takeSnapshots"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API runs E2E interaction and takes heap snapshots.\nThis is equivalent to running ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab snapshot")," in CLI."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runoptions"},(0,r.yg)("inlineCode",{parentName:"a"},"RunOptions"))," | configure browser interaction run"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader")),">"," | a utility reading browser interaction results from disk"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await takeSnapshots({scenario});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L221"},"api/src/API.ts:221"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"warmupandtakesnapshotsoptions"},(0,r.yg)("a",{id:"warmupandtakesnapshots"}),(0,r.yg)("strong",{parentName:"h3"},"warmupAndTakeSnapshots"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,r.yg)("p",null,"This API warms up web server, runs E2E interaction, and takes heap snapshots.\nThis is equivalent to running ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab warmup-and-snapshot")," in CLI.\nThis is also equivalent to warm up and call ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#takesnapshots"},"takeSnapshots"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/api_src#runoptions"},(0,r.yg)("inlineCode",{parentName:"a"},"RunOptions"))," | configure browser interaction run"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,r.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader")),">"," | browser interaction results"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"const {warmupAndTakeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n };\n const result = await warmupAndTakeSnapshots({scenario});\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/API.ts#L151"},"api/src/API.ts:151"))))))}y.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/95206942.b30f45e9.js b/assets/js/95206942.4a54f404.js similarity index 98% rename from assets/js/95206942.b30f45e9.js rename to assets/js/95206942.4a54f404.js index fe39f3613..6d47f8a91 100644 --- a/assets/js/95206942.b30f45e9.js +++ b/assets/js/95206942.4a54f404.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2522],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>u});var l=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function t(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=l.createContext({}),p=function(e){var a=l.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return l.createElement(o.Provider,{value:a},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},m=l.forwardRef((function(e,a){var n=e.components,s=e.mdxType,t=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),m=s,u=c["".concat(o,".").concat(m)]||c[m]||g[m]||t;return n?l.createElement(u,i(i({ref:a},y),{},{components:n})):l.createElement(u,i({ref:a},y))}));function u(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var t=n.length,i=new Array(t);i[0]=m;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>g,frontMatter:()=>t,metadata:()=>r,toc:()=>p});var l=n(8168),s=(n(6540),n(5680));const t={id:"heap_analysis_src.CollectionsHoldingStaleAnalysis",title:"Class: CollectionsHoldingStaleAnalysis",sidebar_label:"CollectionsHoldingStaleAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",id:"api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",title:"Class: CollectionsHoldingStaleAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.CollectionsHoldingStaleAnalysis",title:"Class: CollectionsHoldingStaleAnalysis",sidebar_label:"CollectionsHoldingStaleAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"BaseAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},next:{title:"DetachedDOMElementAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new CollectionsHoldingStaleAnalysis()',id:"new-collectionsholdingstaleanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function g(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,l.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"CollectionsHoldingStaleAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-collectionsholdingstaleanalysis"},(0,s.yg)("a",{id:"new collectionsholdingstaleanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new CollectionsHoldingStaleAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/CollectionsHoldingStaleAnalysis.ts#L67"},"heap-analysis/src/plugins/CollectionsHoldingStaleAnalysis.ts:67"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[2522],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>u});var l=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function t(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=l.createContext({}),p=function(e){var a=l.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return l.createElement(o.Provider,{value:a},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},m=l.forwardRef((function(e,a){var n=e.components,s=e.mdxType,t=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),m=s,u=c["".concat(o,".").concat(m)]||c[m]||g[m]||t;return n?l.createElement(u,i(i({ref:a},y),{},{components:n})):l.createElement(u,i({ref:a},y))}));function u(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var t=n.length,i=new Array(t);i[0]=m;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>g,frontMatter:()=>t,metadata:()=>r,toc:()=>p});var l=n(8168),s=(n(6540),n(5680));const t={id:"heap_analysis_src.CollectionsHoldingStaleAnalysis",title:"Class: CollectionsHoldingStaleAnalysis",sidebar_label:"CollectionsHoldingStaleAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",id:"api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",title:"Class: CollectionsHoldingStaleAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.CollectionsHoldingStaleAnalysis",title:"Class: CollectionsHoldingStaleAnalysis",sidebar_label:"CollectionsHoldingStaleAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"BaseAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},next:{title:"DetachedDOMElementAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new CollectionsHoldingStaleAnalysis()',id:"new-collectionsholdingstaleanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function g(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,l.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"CollectionsHoldingStaleAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-collectionsholdingstaleanalysis"},(0,s.yg)("a",{id:"new collectionsholdingstaleanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new CollectionsHoldingStaleAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/CollectionsHoldingStaleAnalysis.ts#L67"},"heap-analysis/src/plugins/CollectionsHoldingStaleAnalysis.ts:67"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/95f47cf5.bcbcdcb1.js b/assets/js/95f47cf5.60e1b663.js similarity index 98% rename from assets/js/95f47cf5.bcbcdcb1.js rename to assets/js/95f47cf5.60e1b663.js index 9f282cd33..2c6a64989 100644 --- a/assets/js/95f47cf5.bcbcdcb1.js +++ b/assets/js/95f47cf5.60e1b663.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[7130],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var s=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var o=s.createContext({}),p=function(e){var a=s.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return s.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return s.createElement(s.Fragment,{},a)}},u=s.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),u=t,g=c["".concat(o,".").concat(u)]||c[u]||m[u]||l;return n?s.createElement(g,i(i({ref:a},y),{},{components:n})):s.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=u;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:t,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var s=n(8168),t=(n(6540),n(5680));const l={id:"heap_analysis_src.ObjectShapeAnalysis",title:"Class: ObjectShapeAnalysis",sidebar_label:"ObjectShapeAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectShapeAnalysis",id:"api/classes/heap_analysis_src.ObjectShapeAnalysis",title:"Class: ObjectShapeAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectShapeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectShapeAnalysis",title:"Class: ObjectShapeAnalysis",sidebar_label:"ObjectShapeAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectShallowAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"},next:{title:"ObjectSizeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectShapeAnalysis()',id:"new-objectshapeanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(c,(0,s.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"ObjectShapeAnalysis"))))),(0,t.yg)("h2",{id:"constructors"},"Constructors"),(0,t.yg)("h3",{id:"new-objectshapeanalysis"},(0,t.yg)("a",{id:"new objectshapeanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"new ObjectShapeAnalysis"),"()"),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,t.yg)("a",{id:"analyzesnapshotfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,t.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,t.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Example"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,t.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getcommandname"},(0,t.yg)("a",{id:"getcommandname"}),(0,t.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,t.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,t.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ObjectShapeAnalysis.ts#L28"},"heap-analysis/src/plugins/ObjectShapeAnalysis.ts:28"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[7130],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var s=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);a&&(s=s.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,s)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var o=s.createContext({}),p=function(e){var a=s.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return s.createElement(o.Provider,{value:a},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return s.createElement(s.Fragment,{},a)}},u=s.forwardRef((function(e,a){var n=e.components,t=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),u=t,g=c["".concat(o,".").concat(u)]||c[u]||m[u]||l;return n?s.createElement(g,i(i({ref:a},y),{},{components:n})):s.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var l=n.length,i=new Array(l);i[0]=u;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:t,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var s=n(8168),t=(n(6540),n(5680));const l={id:"heap_analysis_src.ObjectShapeAnalysis",title:"Class: ObjectShapeAnalysis",sidebar_label:"ObjectShapeAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectShapeAnalysis",id:"api/classes/heap_analysis_src.ObjectShapeAnalysis",title:"Class: ObjectShapeAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectShapeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectShapeAnalysis",title:"Class: ObjectShapeAnalysis",sidebar_label:"ObjectShapeAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectShallowAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"},next:{title:"ObjectSizeAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectShapeAnalysis()',id:"new-objectshapeanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function m(e){let{components:a,...n}=e;return(0,t.yg)(c,(0,s.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,t.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"ObjectShapeAnalysis"))))),(0,t.yg)("h2",{id:"constructors"},"Constructors"),(0,t.yg)("h3",{id:"new-objectshapeanalysis"},(0,t.yg)("a",{id:"new objectshapeanalysis"}),(0,t.yg)("strong",{parentName:"h3"},"new ObjectShapeAnalysis"),"()"),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,t.yg)("a",{id:"analyzesnapshotfromfile"}),(0,t.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,t.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,t.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,t.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,t.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,t.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Example"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,t.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getcommandname"},(0,t.yg)("a",{id:"getcommandname"}),(0,t.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,t.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,t.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,t.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ObjectShapeAnalysis.ts#L28"},"heap-analysis/src/plugins/ObjectShapeAnalysis.ts:28"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/98c9c166.edf58baf.js b/assets/js/98c9c166.af6a7b11.js similarity index 92% rename from assets/js/98c9c166.edf58baf.js rename to assets/js/98c9c166.af6a7b11.js index a2a6fad47..24eb5a795 100644 --- a/assets/js/98c9c166.edf58baf.js +++ b/assets/js/98c9c166.af6a7b11.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[984],{5680:(e,n,a)=>{a.d(n,{xA:()=>g,yg:()=>y});var r=a(6540);function t(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function o(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var n=1;n=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var p=r.createContext({}),s=function(e){var n=r.useContext(p),a=n;return e&&(a="function"==typeof e?e(n):i(i({},n),e)),a},g=function(e){var n=s(e.components);return r.createElement(p.Provider,{value:n},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},m=r.forwardRef((function(e,n){var a=e.components,t=e.mdxType,o=e.originalType,p=e.parentName,g=l(e,["components","mdxType","originalType","parentName"]),c=s(a),m=t,y=c["".concat(p,".").concat(m)]||c[m]||d[m]||o;return a?r.createElement(y,i(i({ref:n},g),{},{components:a})):r.createElement(y,i({ref:n},g))}));function y(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var o=a.length,i=new Array(o);i[0]=m;var l={};for(var p in n)hasOwnProperty.call(n,p)&&(l[p]=n[p]);l.originalType=e,l[c]="string"==typeof e?e:t,i[1]=l;for(var s=2;s{a.r(n),a.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>d,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var r=a(8168),t=(a(6540),a(5680));const o={id:"core_src.IHeapEdge",title:"Interface: IHeapEdge",sidebar_label:"IHeapEdge",custom_edit_url:null},i=void 0,l={unversionedId:"api/interfaces/core_src.IHeapEdge",id:"api/interfaces/core_src.IHeapEdge",title:"Interface: IHeapEdge",description:"An IHeapEdge instance represents a JS reference in a heap snapshot.",source:"@site/docs/api/interfaces/core_src.IHeapEdge.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapEdge",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdge",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapEdge",title:"Interface: IHeapEdge",sidebar_label:"IHeapEdge",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IBrowserInfo",permalink:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"},next:{title:"IHeapEdges",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdges"}},p={},s=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Properties",id:"properties",level:2},{value:' edgeIndex: number',id:"-edgeindex-number",level:3},{value:' fromNode: IHeapNode',id:"-fromnode-iheapnode",level:3},{value:' is_index: boolean',id:"-is_index-boolean",level:3},{value:' name_or_index: string | number',id:"-name_or_index-string--number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:' toNode: IHeapNode',id:"-tonode-iheapnode",level:3},{value:' to_node: number',id:"-to_node-number",level:3},{value:' type: string',id:"-type-string",level:3},{value:"Methods",id:"methods",level:2},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3}],g={toc:s},c="wrapper";function d(e){let{components:n,...a}=e;return(0,t.yg)(c,(0,r.A)({},g,a,{components:n,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"An ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapEdge")," instance represents a JS reference in a heap snapshot.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapEdge")," instance"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapEdge} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each edge (JS reference in heap)\n heap.edges.forEach((edge: IHeapEdge, i: number) => {\n // use the heap edge APIs here\n const nameOrIndex = edge.name_or_index;\n // ...\n });\n})();\n")),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("inlineCode",{parentName:"p"},"IHeapEdgeBasic")),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"IHeapEdge"))))),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-edgeindex-number"},(0,t.yg)("a",{id:"edgeindex",name:"edgeindex"})," ",(0,t.yg)("strong",{parentName:"h3"},"edgeIndex"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"index of this JS reference inside the ",(0,t.yg)("inlineCode",{parentName:"p"},"edge.snapshot.edges")," pseudo array"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1668"},"core/src/lib/Types.ts:1668"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-fromnode-iheapnode"},(0,t.yg)("a",{id:"fromnode",name:"fromnode"})," ",(0,t.yg)("strong",{parentName:"h3"},"fromNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode"))),(0,t.yg)("p",null,"returns an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," instance representing the hosting\nJS heap object where this reference starts"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1689"},"core/src/lib/Types.ts:1689"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-is_index-boolean"},(0,t.yg)("a",{id:"is\\_index",name:"is\\_index"})," ",(0,t.yg)("strong",{parentName:"h3"},"is","_","index"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"if ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", means this is a reference to an array element\nor internal table element (",(0,t.yg)("inlineCode",{parentName:"p"},"edge.name_or_index")," will return a number),\notherwise this is a reference with a string name (",(0,t.yg)("inlineCode",{parentName:"p"},"edge.name_or_index"),"\nwill return a string)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1675"},"core/src/lib/Types.ts:1675"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-name_or_index-string--number"},(0,t.yg)("a",{id:"name\\_or\\_index",name:"name\\_or\\_index"})," ",(0,t.yg)("strong",{parentName:"h3"},"name","_","or","_","index"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"name of the JS reference. If this is a reference to an array element\nor internal table element, it is an numeric index"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1624"},"core/src/lib/Types.ts:1624"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,t.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,t.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,t.yg)("p",null,"get the ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this JS reference"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1664"},"core/src/lib/Types.ts:1664"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-tonode-iheapnode"},(0,t.yg)("a",{id:"tonode",name:"tonode"})," ",(0,t.yg)("strong",{parentName:"h3"},"toNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode"))),(0,t.yg)("p",null,"returns an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," instance representing the JS heap object\npointed to by this reference"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1684"},"core/src/lib/Types.ts:1684"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-to_node-number"},(0,t.yg)("a",{id:"to\\_node",name:"to\\_node"})," ",(0,t.yg)("strong",{parentName:"h3"},"to","_","node"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"the index of the JS heap object pointed to by this reference"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1679"},"core/src/lib/Types.ts:1679"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-type-string"},(0,t.yg)("a",{id:"type",name:"type"})," ",(0,t.yg)("strong",{parentName:"h3"},"type"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"type of the JS reference, all types:\n",(0,t.yg)("inlineCode",{parentName:"p"},"context"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"element"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"property"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"internal"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"hidden"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"shortcut"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"weak")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1629"},"core/src/lib/Types.ts:1629"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"getjsonifyableobject"},(0,t.yg)("a",{id:"getjsonifyableobject"}),(0,t.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,t.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1697"},"core/src/lib/Types.ts:1697"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tojsonstringargs"},(0,t.yg)("a",{id:"tojsonstring"}),(0,t.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,t.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,t.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"Note: Please be aware that using ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,t.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1710"},"core/src/lib/Types.ts:1710"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[984],{5680:(e,n,a)=>{a.d(n,{xA:()=>g,yg:()=>y});var r=a(6540);function t(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function o(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,r)}return a}function i(e){for(var n=1;n=0||(t[a]=e[a]);return t}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(t[a]=e[a])}return t}var p=r.createContext({}),s=function(e){var n=r.useContext(p),a=n;return e&&(a="function"==typeof e?e(n):i(i({},n),e)),a},g=function(e){var n=s(e.components);return r.createElement(p.Provider,{value:n},e.children)},c="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.createElement(r.Fragment,{},n)}},d=r.forwardRef((function(e,n){var a=e.components,t=e.mdxType,o=e.originalType,p=e.parentName,g=l(e,["components","mdxType","originalType","parentName"]),c=s(a),d=t,y=c["".concat(p,".").concat(d)]||c[d]||m[d]||o;return a?r.createElement(y,i(i({ref:n},g),{},{components:a})):r.createElement(y,i({ref:n},g))}));function y(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var o=a.length,i=new Array(o);i[0]=d;var l={};for(var p in n)hasOwnProperty.call(n,p)&&(l[p]=n[p]);l.originalType=e,l[c]="string"==typeof e?e:t,i[1]=l;for(var s=2;s{a.r(n),a.d(n,{assets:()=>p,contentTitle:()=>i,default:()=>m,frontMatter:()=>o,metadata:()=>l,toc:()=>s});var r=a(8168),t=(a(6540),a(5680));const o={id:"core_src.IHeapEdge",title:"Interface: IHeapEdge",sidebar_label:"IHeapEdge",custom_edit_url:null},i=void 0,l={unversionedId:"api/interfaces/core_src.IHeapEdge",id:"api/interfaces/core_src.IHeapEdge",title:"Interface: IHeapEdge",description:"An IHeapEdge instance represents a JS reference in a heap snapshot.",source:"@site/docs/api/interfaces/core_src.IHeapEdge.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapEdge",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdge",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapEdge",title:"Interface: IHeapEdge",sidebar_label:"IHeapEdge",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IBrowserInfo",permalink:"/memlab/docs/api/interfaces/core_src.IBrowserInfo"},next:{title:"IHeapEdges",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdges"}},p={},s=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Properties",id:"properties",level:2},{value:' edgeIndex: number',id:"-edgeindex-number",level:3},{value:' fromNode: IHeapNode',id:"-fromnode-iheapnode",level:3},{value:' is_index: boolean',id:"-is_index-boolean",level:3},{value:' name_or_index: string | number',id:"-name_or_index-string--number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:' toNode: IHeapNode',id:"-tonode-iheapnode",level:3},{value:' to_node: number',id:"-to_node-number",level:3},{value:' type: string',id:"-type-string",level:3},{value:"Methods",id:"methods",level:2},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3}],g={toc:s},c="wrapper";function m(e){let{components:n,...a}=e;return(0,t.yg)(c,(0,r.A)({},g,a,{components:n,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"An ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapEdge")," instance represents a JS reference in a heap snapshot.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,t.yg)("inlineCode",{parentName:"p"},"IHeapEdge")," instance"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapEdge} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each edge (JS reference in heap)\n heap.edges.forEach((edge: IHeapEdge, i: number) => {\n // use the heap edge APIs here\n const nameOrIndex = edge.name_or_index;\n // ...\n });\n})();\n")),(0,t.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("inlineCode",{parentName:"p"},"IHeapEdgeBasic")),(0,t.yg)("p",{parentName:"li"},"\u21b3 ",(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"IHeapEdge"))))),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-edgeindex-number"},(0,t.yg)("a",{id:"edgeindex",name:"edgeindex"})," ",(0,t.yg)("strong",{parentName:"h3"},"edgeIndex"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"index of this JS reference inside the ",(0,t.yg)("inlineCode",{parentName:"p"},"edge.snapshot.edges")," pseudo array"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1668"},"core/src/lib/Types.ts:1668"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-fromnode-iheapnode"},(0,t.yg)("a",{id:"fromnode",name:"fromnode"})," ",(0,t.yg)("strong",{parentName:"h3"},"fromNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode"))),(0,t.yg)("p",null,"returns an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," instance representing the hosting\nJS heap object where this reference starts"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1689"},"core/src/lib/Types.ts:1689"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-is_index-boolean"},(0,t.yg)("a",{id:"is\\_index",name:"is\\_index"})," ",(0,t.yg)("strong",{parentName:"h3"},"is","_","index"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"boolean")),(0,t.yg)("p",null,"if ",(0,t.yg)("inlineCode",{parentName:"p"},"true"),", means this is a reference to an array element\nor internal table element (",(0,t.yg)("inlineCode",{parentName:"p"},"edge.name_or_index")," will return a number),\notherwise this is a reference with a string name (",(0,t.yg)("inlineCode",{parentName:"p"},"edge.name_or_index"),"\nwill return a string)"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1675"},"core/src/lib/Types.ts:1675"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-name_or_index-string--number"},(0,t.yg)("a",{id:"name\\_or\\_index",name:"name\\_or\\_index"})," ",(0,t.yg)("strong",{parentName:"h3"},"name","_","or","_","index"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"name of the JS reference. If this is a reference to an array element\nor internal table element, it is an numeric index"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1624"},"core/src/lib/Types.ts:1624"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,t.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,t.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,t.yg)("p",null,"get the ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this JS reference"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1664"},"core/src/lib/Types.ts:1664"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-tonode-iheapnode"},(0,t.yg)("a",{id:"tonode",name:"tonode"})," ",(0,t.yg)("strong",{parentName:"h3"},"toNode"),": ",(0,t.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode"))),(0,t.yg)("p",null,"returns an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," instance representing the JS heap object\npointed to by this reference"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1684"},"core/src/lib/Types.ts:1684"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-to_node-number"},(0,t.yg)("a",{id:"to\\_node",name:"to\\_node"})," ",(0,t.yg)("strong",{parentName:"h3"},"to","_","node"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"the index of the JS heap object pointed to by this reference"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1679"},"core/src/lib/Types.ts:1679"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"-type-string"},(0,t.yg)("a",{id:"type",name:"type"})," ",(0,t.yg)("strong",{parentName:"h3"},"type"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"string")),(0,t.yg)("p",null,"type of the JS reference, all types:\n",(0,t.yg)("inlineCode",{parentName:"p"},"context"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"element"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"property"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"internal"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"hidden"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"shortcut"),", ",(0,t.yg)("inlineCode",{parentName:"p"},"weak")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1629"},"core/src/lib/Types.ts:1629"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"getjsonifyableobject"},(0,t.yg)("a",{id:"getjsonifyableobject"}),(0,t.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,t.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1697"},"core/src/lib/Types.ts:1697"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"tojsonstringargs"},(0,t.yg)("a",{id:"tojsonstring"}),(0,t.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,t.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,t.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,t.yg)("p",null,"Note: Please be aware that using ",(0,t.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,t.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"string")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1710"},"core/src/lib/Types.ts:1710"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/b53f1d78.b6db68f3.js b/assets/js/b53f1d78.67102bec.js similarity index 95% rename from assets/js/b53f1d78.b6db68f3.js rename to assets/js/b53f1d78.67102bec.js index 1e4277f91..94cbbd520 100644 --- a/assets/js/b53f1d78.b6db68f3.js +++ b/assets/js/b53f1d78.67102bec.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[3925],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>y});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),p=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},c=function(e){var a=p(e.components);return t.createElement(s.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),g=p(n),u=r,y=g["".concat(s,".").concat(u)]||g[u]||m[u]||o;return n?t.createElement(y,l(l({ref:a},c),{},{components:n})):t.createElement(y,l({ref:a},c))}));function y(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=u;var i={};for(var s in a)hasOwnProperty.call(a,s)&&(i[s]=a[s]);i.originalType=e,i[g]="string"==typeof e?e:r,l[1]=i;for(var p=2;p{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var t=n(8168),r=(n(6540),n(5680));const o={id:"core_src.IHeapLocation",title:"Interface: IHeapLocation",sidebar_label:"IHeapLocation",custom_edit_url:null},l=void 0,i={unversionedId:"api/interfaces/core_src.IHeapLocation",id:"api/interfaces/core_src.IHeapLocation",title:"Interface: IHeapLocation",description:"An IHeapLocation instance contains a source location information",source:"@site/docs/api/interfaces/core_src.IHeapLocation.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapLocation",permalink:"/memlab/docs/api/interfaces/core_src.IHeapLocation",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapLocation",title:"Interface: IHeapLocation",sidebar_label:"IHeapLocation",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapEdges",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdges"},next:{title:"IHeapNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNode"}},s={},p=[{value:"Properties",id:"properties",level:2},{value:' column: number',id:"-column-number",level:3},{value:' line: number',id:"-line-number",level:3},{value:' node: Nullable<IHeapNode>',id:"-node-nullableiheapnode",level:3},{value:' script_id: number',id:"-script_id-number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:"Methods",id:"methods",level:2},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3}],c={toc:p},g="wrapper";function m(e){let{components:a,...n}=e;return(0,r.yg)(g,(0,t.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"An ",(0,r.yg)("inlineCode",{parentName:"p"},"IHeapLocation")," instance contains a source location information\nassociated with a JS heap object.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},(0,r.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,r.yg)("inlineCode",{parentName:"p"},"IHeapLocation")," instance"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode, IHeapLocation} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each node (heap object)\n heap.nodes.forEach((node: IHeapNode, i: number) => {\n const location: Nullable = node.location;\n if (location) {\n // use the location API here\n location.line;\n // ...\n }\n });\n})();\n")),(0,r.yg)("h2",{id:"properties"},"Properties"),(0,r.yg)("h3",{id:"-column-number"},(0,r.yg)("a",{id:"column",name:"column"})," ",(0,r.yg)("strong",{parentName:"h3"},"column"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"number")),(0,r.yg)("p",null,"get the column number"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1594"},"core/src/lib/Types.ts:1594"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-line-number"},(0,r.yg)("a",{id:"line",name:"line"})," ",(0,r.yg)("strong",{parentName:"h3"},"line"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"number")),(0,r.yg)("p",null,"get the line number"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1590"},"core/src/lib/Types.ts:1590"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-node-nullableiheapnode"},(0,r.yg)("a",{id:"node",name:"node"})," ",(0,r.yg)("strong",{parentName:"h3"},"node"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"),(0,r.yg)("p",null,"get the heap object this location this location represents"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1582"},"core/src/lib/Types.ts:1582"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-script_id-number"},(0,r.yg)("a",{id:"script\\_id",name:"script\\_id"})," ",(0,r.yg)("strong",{parentName:"h3"},"script","_","id"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"number")),(0,r.yg)("p",null,"get the script ID of the source file"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1586"},"core/src/lib/Types.ts:1586"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,r.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,r.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,r.yg)("p",null,"get the ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this location instance"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1578"},"core/src/lib/Types.ts:1578"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"getjsonifyableobject"},(0,r.yg)("a",{id:"getjsonifyableobject"}),(0,r.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,r.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,r.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,r.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1602"},"core/src/lib/Types.ts:1602"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"tojsonstringargs"},(0,r.yg)("a",{id:"tojsonstring"}),(0,r.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,r.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,r.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,r.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,r.yg)("p",null,"Note: Please be aware that using ",(0,r.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,r.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1615"},"core/src/lib/Types.ts:1615"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[3925],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>y});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),p=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},c=function(e){var a=p(e.components);return t.createElement(s.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},u=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),g=p(n),u=r,y=g["".concat(s,".").concat(u)]||g[u]||m[u]||o;return n?t.createElement(y,l(l({ref:a},c),{},{components:n})):t.createElement(y,l({ref:a},c))}));function y(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=u;var i={};for(var s in a)hasOwnProperty.call(a,s)&&(i[s]=a[s]);i.originalType=e,i[g]="string"==typeof e?e:r,l[1]=i;for(var p=2;p{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>l,default:()=>m,frontMatter:()=>o,metadata:()=>i,toc:()=>p});var t=n(8168),r=(n(6540),n(5680));const o={id:"core_src.IHeapLocation",title:"Interface: IHeapLocation",sidebar_label:"IHeapLocation",custom_edit_url:null},l=void 0,i={unversionedId:"api/interfaces/core_src.IHeapLocation",id:"api/interfaces/core_src.IHeapLocation",title:"Interface: IHeapLocation",description:"An IHeapLocation instance contains a source location information",source:"@site/docs/api/interfaces/core_src.IHeapLocation.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapLocation",permalink:"/memlab/docs/api/interfaces/core_src.IHeapLocation",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapLocation",title:"Interface: IHeapLocation",sidebar_label:"IHeapLocation",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapEdges",permalink:"/memlab/docs/api/interfaces/core_src.IHeapEdges"},next:{title:"IHeapNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNode"}},s={},p=[{value:"Properties",id:"properties",level:2},{value:' column: number',id:"-column-number",level:3},{value:' line: number',id:"-line-number",level:3},{value:' node: Nullable<IHeapNode>',id:"-node-nullableiheapnode",level:3},{value:' script_id: number',id:"-script_id-number",level:3},{value:' snapshot: IHeapSnapshot',id:"-snapshot-iheapsnapshot",level:3},{value:"Methods",id:"methods",level:2},{value:'getJSONifyableObject()',id:"getjsonifyableobject",level:3},{value:'toJSONString(...args)',id:"tojsonstringargs",level:3}],c={toc:p},g="wrapper";function m(e){let{components:a,...n}=e;return(0,r.yg)(g,(0,t.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"An ",(0,r.yg)("inlineCode",{parentName:"p"},"IHeapLocation")," instance contains a source location information\nassociated with a JS heap object.\nA heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects."),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},(0,r.yg)("inlineCode",{parentName:"strong"},"readonly"))," it is not recommended to modify any ",(0,r.yg)("inlineCode",{parentName:"p"},"IHeapLocation")," instance"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),": V8 or hermes heap snapshot can be parsed by the\n",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#getfullheapfromfile"},"getFullHeapFromFile")," API.")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode, IHeapLocation} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // iterate over each node (heap object)\n heap.nodes.forEach((node: IHeapNode, i: number) => {\n const location: Nullable = node.location;\n if (location) {\n // use the location API here\n location.line;\n // ...\n }\n });\n})();\n")),(0,r.yg)("h2",{id:"properties"},"Properties"),(0,r.yg)("h3",{id:"-column-number"},(0,r.yg)("a",{id:"column",name:"column"})," ",(0,r.yg)("strong",{parentName:"h3"},"column"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"number")),(0,r.yg)("p",null,"get the column number"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1594"},"core/src/lib/Types.ts:1594"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-line-number"},(0,r.yg)("a",{id:"line",name:"line"})," ",(0,r.yg)("strong",{parentName:"h3"},"line"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"number")),(0,r.yg)("p",null,"get the line number"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1590"},"core/src/lib/Types.ts:1590"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-node-nullableiheapnode"},(0,r.yg)("a",{id:"node",name:"node"})," ",(0,r.yg)("strong",{parentName:"h3"},"node"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"),(0,r.yg)("p",null,"get the heap object this location this location represents"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1582"},"core/src/lib/Types.ts:1582"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-script_id-number"},(0,r.yg)("a",{id:"script\\_id",name:"script\\_id"})," ",(0,r.yg)("strong",{parentName:"h3"},"script","_","id"),": ",(0,r.yg)("inlineCode",{parentName:"h3"},"number")),(0,r.yg)("p",null,"get the script ID of the source file"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1586"},"core/src/lib/Types.ts:1586"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-snapshot-iheapsnapshot"},(0,r.yg)("a",{id:"snapshot",name:"snapshot"})," ",(0,r.yg)("strong",{parentName:"h3"},"snapshot"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapSnapshot"))),(0,r.yg)("p",null,"get the ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," containing this location instance"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1578"},"core/src/lib/Types.ts:1578"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"getjsonifyableobject"},(0,r.yg)("a",{id:"getjsonifyableobject"}),(0,r.yg)("strong",{parentName:"h3"},"getJSONifyableObject"),"()"),(0,r.yg)("p",null,"convert to a concise readable object that can be used for serialization\n(like calling ",(0,r.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,r.yg)("p",null,"This API does not contain all the information\ncaptured by the hosting object."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"AnyRecord")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1602"},"core/src/lib/Types.ts:1602"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"tojsonstringargs"},(0,r.yg)("a",{id:"tojsonstring"}),(0,r.yg)("strong",{parentName:"h3"},"toJSONString"),"(...",(0,r.yg)("inlineCode",{parentName:"h3"},"args"),")"),(0,r.yg)("p",null,"convert to a concise readable string output\n(like calling ",(0,r.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)"),")."),(0,r.yg)("p",null,"Note: Please be aware that using ",(0,r.yg)("inlineCode",{parentName:"p"},"JSON.stringify(node, ...args)")," is\nnot recommended as it will generate a JSON representation of the host\nobject that is too large to be easily readable due to its connections\nto other parts of the data structures within the heap snapshot."),(0,r.yg)("p",null,"This API does not completely serialize all the information\ncaptured by the hosting object."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"...args"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"any"),"[]"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1615"},"core/src/lib/Types.ts:1615"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/c90dd339.1b56382d.js b/assets/js/c90dd339.08246fda.js similarity index 95% rename from assets/js/c90dd339.1b56382d.js rename to assets/js/c90dd339.08246fda.js index 246b61389..268c0a5d4 100644 --- a/assets/js/c90dd339.1b56382d.js +++ b/assets/js/c90dd339.08246fda.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1456],{5680:(e,a,n)=>{n.d(a,{xA:()=>m,yg:()=>y});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),i=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},m=function(e){var a=i(e.components);return t.createElement(s.Provider,{value:a},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},d=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),c=i(n),d=r,y=c["".concat(s,".").concat(d)]||c[d]||g[d]||o;return n?t.createElement(y,l(l({ref:a},m),{},{components:n})):t.createElement(y,l({ref:a},m))}));function y(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=d;var p={};for(var s in a)hasOwnProperty.call(a,s)&&(p[s]=a[s]);p.originalType=e,p[c]="string"==typeof e?e:r,l[1]=p;for(var i=2;i{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>l,default:()=>g,frontMatter:()=>o,metadata:()=>p,toc:()=>i});var t=n(8168),r=(n(6540),n(5680));const o={id:"core_src.IHeapSnapshot",title:"Interface: IHeapSnapshot",sidebar_label:"IHeapSnapshot",custom_edit_url:null},l=void 0,p={unversionedId:"api/interfaces/core_src.IHeapSnapshot",id:"api/interfaces/core_src.IHeapSnapshot",title:"Interface: IHeapSnapshot",description:"A heap snapshot is generally a graph where graph nodes are JS heap objects",source:"@site/docs/api/interfaces/core_src.IHeapSnapshot.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapSnapshot",permalink:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapSnapshot",title:"Interface: IHeapSnapshot",sidebar_label:"IHeapSnapshot",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapNodes",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNodes"},next:{title:"IHeapStringNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"}},s={},i=[{value:"Properties",id:"properties",level:2},{value:' edges: IHeapEdges',id:"-edges-iheapedges",level:3},{value:' nodes: IHeapNodes',id:"-nodes-iheapnodes",level:3},{value:"Methods",id:"methods",level:2},{value:'getAnyObjectWithClassName(className)',id:"getanyobjectwithclassnameclassname",level:3},{value:'getNodeById(id)',id:"getnodebyidid",level:3},{value:'getNodesByIdSet(ids)',id:"getnodesbyidsetids",level:3},{value:'getNodesByIds(ids)',id:"getnodesbyidsids",level:3},{value:'hasObjectWithClassName(className)',id:"hasobjectwithclassnameclassname",level:3},{value:'hasObjectWithPropertyName(nameOrIndex)',id:"hasobjectwithpropertynamenameorindex",level:3},{value:'hasObjectWithTag(tag)',id:"hasobjectwithtagtag",level:3}],m={toc:i},c="wrapper";function g(e){let{components:a,...n}=e;return(0,r.yg)(c,(0,t.A)({},m,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"A heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects. For more details\non the structure of nodes and edges in the heap graph, check out\n",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," and ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge"),"."),(0,r.yg)("h2",{id:"properties"},"Properties"),(0,r.yg)("h3",{id:"-edges-iheapedges"},(0,r.yg)("a",{id:"edges",name:"edges"})," ",(0,r.yg)("strong",{parentName:"h3"},"edges"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdges"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdges"))),(0,r.yg)("p",null,"A pseudo array containing all heap graph edges (references to heap objects\nin heap). A JS heap could contain millions of references, so memlab uses\na pseudo array as the collection of all the heap edges. The pseudo\narray provides API to query and traverse all heap references."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapEdge} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // get the total number of heap references\n heap.edges.length;\n\n heap.edges.forEach((edge: IHeapEdge) => {\n // traverse each reference in the heap\n });\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1332"},"core/src/lib/Types.ts:1332"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-nodes-iheapnodes"},(0,r.yg)("a",{id:"nodes",name:"nodes"})," ",(0,r.yg)("strong",{parentName:"h3"},"nodes"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNodes"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNodes"))),(0,r.yg)("p",null,"A pseudo array containing all heap graph nodes (JS objects in heap).\nA JS heap could contain millions of heap objects, so memlab uses\na pseudo array as the collection of all the heap objects. The pseudo\narray provides API to query and traverse all heap objects."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // get the total number of heap objects\n heap.nodes.length;\n\n heap.nodes.forEach((node: IHeapNode) => {\n // traverse each heap object\n });\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1306"},"core/src/lib/Types.ts:1306"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"getanyobjectwithclassnameclassname"},(0,r.yg)("a",{id:"getanyobjectwithclassname"}),(0,r.yg)("strong",{parentName:"h3"},"getAnyObjectWithClassName"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"className"),")"),(0,r.yg)("p",null,"Search for the heap and get one of the JS object instances with\na specified constructor name (if there is any)."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"className"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | The constructor name of the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | a handle pointing to any one of the object instances, returns\n",(0,r.yg)("inlineCode",{parentName:"p"},"null")," if no such object exists in the heap.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {takeNodeMinimalHeap} from '@memlab/core';\n\nclass TestObject {\n public arr1 = [1, 2, 3];\n public arr2 = ['1', '2', '3'];\n}\n\n(async function () {\n const obj = new TestObject();\n // get a heap snapshot of the current program state\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n const node = heap.getAnyObjectWithClassName('TestObject');\n console.log(node?.name); // should be 'TestObject'\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1473"},"core/src/lib/Types.ts:1473"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getnodebyidid"},(0,r.yg)("a",{id:"getnodebyid"}),(0,r.yg)("strong",{parentName:"h3"},"getNodeById"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"id"),")"),(0,r.yg)("p",null,"If you have the id of a heap node (JS object in heap), use this API\nto get an ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," associated with the id."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"id"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"number")," | id of the heap node (JS object in heap) you would like to query"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the API returns ",(0,r.yg)("inlineCode",{parentName:"p"},"null")," if no heap object has the specified id.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n const node = heap.getNodeById(351);\n node?.id; // should be 351\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1354"},"core/src/lib/Types.ts:1354"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getnodesbyidsetids"},(0,r.yg)("a",{id:"getnodesbyidset"}),(0,r.yg)("strong",{parentName:"h3"},"getNodesByIdSet"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"ids"),")"),(0,r.yg)("p",null,"Given a set of ids of heap nodes (JS objects in heap), use this API\nto get a set of those heap nodes."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"ids"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Set"),"<",(0,r.yg)("inlineCode",{parentName:"li"},"number"),">"," | id set of the heap nodes (JS objects in heap) you would like to query"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Set"),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | a set of those heap nodes. The set will only include\nnodes that are found in the heap. If none of the input ids are found,\nthis API will return an empty set.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // suppose 1000 is not a valid id in the heap\n const set = heap.getNodesByIdSet(new Set([1, 2, 1000, 3]));\n set // should be Set([node1, node2, node3])\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1406"},"core/src/lib/Types.ts:1406"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getnodesbyidsids"},(0,r.yg)("a",{id:"getnodesbyids"}),(0,r.yg)("strong",{parentName:"h3"},"getNodesByIds"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"ids"),")"),(0,r.yg)("p",null,"Given an array of ids of heap nodes (JS objects in heap), use this API\nto get an array of those heap nodes."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"ids"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"number"),"[] | id array of the heap nodes (JS objects in heap) you would like to query"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">","[] | an array of those heap nodes. The return array will preserve the\norder of the input array. If an id is not found in the heap, the\ncorresponding element in the return array will be ",(0,r.yg)("inlineCode",{parentName:"p"},"null"),".")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // suppose 1000 is not a valid id in the heap\n const nodes = heap.getNodesByIds([1, 2, 1000, 3]);\n nodes // should be [node1, node2, null, node3]\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1380"},"core/src/lib/Types.ts:1380"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"hasobjectwithclassnameclassname"},(0,r.yg)("a",{id:"hasobjectwithclassname"}),(0,r.yg)("strong",{parentName:"h3"},"hasObjectWithClassName"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"className"),")"),(0,r.yg)("p",null,"Search for the heap and check if there is any JS object instance with\na specified constructor name."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"className"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | The constructor name of the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," | ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," if there is at least one such object in the heap")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),": you can write a jest unit test with memory assertions:"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"// save as example.test.ts\nimport type {IHeapSnapshot, Nullable} from '@memlab/core';\nimport {config, takeNodeMinimalHeap} from '@memlab/core';\n\nclass TestObject {\n public arr1 = [1, 2, 3];\n public arr2 = ['1', '2', '3'];\n}\n\ntest('memory test with heap assertion', async () => {\n config.muteConsole = true; // no console output\n\n let obj: Nullable = new TestObject();\n // get a heap snapshot of the current program state\n let heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n // call some function that may add references to obj\n rabbitHole(obj)\n\n expect(heap.hasObjectWithClassName('TestObject')).toBe(true);\n obj = null;\n\n heap = await takeNodeMinimalHeap();\n // if rabbitHole does not have any side effect that\n // adds new references to obj, then obj can be GCed\n expect(heap.hasObjectWithClassName('TestObject')).toBe(false);\n\n}, 30000);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1445"},"core/src/lib/Types.ts:1445"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"hasobjectwithpropertynamenameorindex"},(0,r.yg)("a",{id:"hasobjectwithpropertyname"}),(0,r.yg)("strong",{parentName:"h3"},"hasObjectWithPropertyName"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"nameOrIndex"),")"),(0,r.yg)("p",null,"Search for the heap and check if there is any JS object instance with\na specified property name."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"nameOrIndex"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"li"},"number")," | The property name (string) or element index (number) on the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," | returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," if there is at least one such object in the heap")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const object = {'memlab-test-heap-property': 'memlab-test-heap-value'};\n\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // should be true\n console.log(heap.hasObjectWithPropertyName('memlab-test-heap-property'));\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1499"},"core/src/lib/Types.ts:1499"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"hasobjectwithtagtag"},(0,r.yg)("a",{id:"hasobjectwithtag"}),(0,r.yg)("strong",{parentName:"h3"},"hasObjectWithTag"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"tag"),")"),(0,r.yg)("p",null,"Search for the heap and check if there is any JS object instance with\na marker tagged by ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#tagobject"},"tagObject"),"."),(0,r.yg)("p",null,"The ",(0,r.yg)("inlineCode",{parentName:"p"},"tagObject")," API does not modify the object instance in any way\n(e.g., no additional or hidden properties added to the tagged object)."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"tag"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | marker name on the object instances tagged by ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#tagobject"},"tagObject")))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | returns ",(0,r.yg)("inlineCode",{parentName:"li"},"true")," if there is at least one such object in the heap")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, AnyValue} from '@memlab/core';\nimport {config, takeNodeMinimalHeap, tagObject} from '@memlab/core';\n\ntest('memory test', async () => {\n config.muteConsole = true;\n const o1: AnyValue = {};\n let o2: AnyValue = {};\n\n // tag o1 with marker: \"memlab-mark-1\", does not modify o1 in any way\n tagObject(o1, 'memlab-mark-1');\n // tag o2 with marker: \"memlab-mark-2\", does not modify o2 in any way\n tagObject(o2, 'memlab-mark-2');\n\n o2 = null;\n\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n // expect object with marker \"memlab-mark-1\" exists\n expect(heap.hasObjectWithTag('memlab-mark-1')).toBe(true);\n\n // expect object with marker \"memlab-mark-2\" can be GCed\n expect(heap.hasObjectWithTag('memlab-mark-2')).toBe(false);\n\n}, 30000);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1537"},"core/src/lib/Types.ts:1537"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[1456],{5680:(e,a,n)=>{n.d(a,{xA:()=>m,yg:()=>d});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),i=function(e){var a=t.useContext(s),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},m=function(e){var a=i(e.components);return t.createElement(s.Provider,{value:a},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},y=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,m=p(e,["components","mdxType","originalType","parentName"]),c=i(n),y=r,d=c["".concat(s,".").concat(y)]||c[y]||g[y]||o;return n?t.createElement(d,l(l({ref:a},m),{},{components:n})):t.createElement(d,l({ref:a},m))}));function d(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=y;var p={};for(var s in a)hasOwnProperty.call(a,s)&&(p[s]=a[s]);p.originalType=e,p[c]="string"==typeof e?e:r,l[1]=p;for(var i=2;i{n.r(a),n.d(a,{assets:()=>s,contentTitle:()=>l,default:()=>g,frontMatter:()=>o,metadata:()=>p,toc:()=>i});var t=n(8168),r=(n(6540),n(5680));const o={id:"core_src.IHeapSnapshot",title:"Interface: IHeapSnapshot",sidebar_label:"IHeapSnapshot",custom_edit_url:null},l=void 0,p={unversionedId:"api/interfaces/core_src.IHeapSnapshot",id:"api/interfaces/core_src.IHeapSnapshot",title:"Interface: IHeapSnapshot",description:"A heap snapshot is generally a graph where graph nodes are JS heap objects",source:"@site/docs/api/interfaces/core_src.IHeapSnapshot.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapSnapshot",permalink:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapSnapshot",title:"Interface: IHeapSnapshot",sidebar_label:"IHeapSnapshot",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapNodes",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNodes"},next:{title:"IHeapStringNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapStringNode"}},s={},i=[{value:"Properties",id:"properties",level:2},{value:' edges: IHeapEdges',id:"-edges-iheapedges",level:3},{value:' nodes: IHeapNodes',id:"-nodes-iheapnodes",level:3},{value:"Methods",id:"methods",level:2},{value:'getAnyObjectWithClassName(className)',id:"getanyobjectwithclassnameclassname",level:3},{value:'getNodeById(id)',id:"getnodebyidid",level:3},{value:'getNodesByIdSet(ids)',id:"getnodesbyidsetids",level:3},{value:'getNodesByIds(ids)',id:"getnodesbyidsids",level:3},{value:'hasObjectWithClassName(className)',id:"hasobjectwithclassnameclassname",level:3},{value:'hasObjectWithPropertyName(nameOrIndex)',id:"hasobjectwithpropertynamenameorindex",level:3},{value:'hasObjectWithTag(tag)',id:"hasobjectwithtagtag",level:3}],m={toc:i},c="wrapper";function g(e){let{components:a,...n}=e;return(0,r.yg)(c,(0,t.A)({},m,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"A heap snapshot is generally a graph where graph nodes are JS heap objects\nand graph edges are JS references among JS heap objects. For more details\non the structure of nodes and edges in the heap graph, check out\n",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," and ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge"),"."),(0,r.yg)("h2",{id:"properties"},"Properties"),(0,r.yg)("h3",{id:"-edges-iheapedges"},(0,r.yg)("a",{id:"edges",name:"edges"})," ",(0,r.yg)("strong",{parentName:"h3"},"edges"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapEdges"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapEdges"))),(0,r.yg)("p",null,"A pseudo array containing all heap graph edges (references to heap objects\nin heap). A JS heap could contain millions of references, so memlab uses\na pseudo array as the collection of all the heap edges. The pseudo\narray provides API to query and traverse all heap references."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapEdge} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // get the total number of heap references\n heap.edges.length;\n\n heap.edges.forEach((edge: IHeapEdge) => {\n // traverse each reference in the heap\n });\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1332"},"core/src/lib/Types.ts:1332"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-nodes-iheapnodes"},(0,r.yg)("a",{id:"nodes",name:"nodes"})," ",(0,r.yg)("strong",{parentName:"h3"},"nodes"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/interfaces/core_src.IHeapNodes"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNodes"))),(0,r.yg)("p",null,"A pseudo array containing all heap graph nodes (JS objects in heap).\nA JS heap could contain millions of heap objects, so memlab uses\na pseudo array as the collection of all the heap objects. The pseudo\narray provides API to query and traverse all heap objects."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNode} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // get the total number of heap objects\n heap.nodes.length;\n\n heap.nodes.forEach((node: IHeapNode) => {\n // traverse each heap object\n });\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1306"},"core/src/lib/Types.ts:1306"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"getanyobjectwithclassnameclassname"},(0,r.yg)("a",{id:"getanyobjectwithclassname"}),(0,r.yg)("strong",{parentName:"h3"},"getAnyObjectWithClassName"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"className"),")"),(0,r.yg)("p",null,"Search for the heap and get one of the JS object instances with\na specified constructor name (if there is any)."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"className"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | The constructor name of the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | a handle pointing to any one of the object instances, returns\n",(0,r.yg)("inlineCode",{parentName:"p"},"null")," if no such object exists in the heap.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {takeNodeMinimalHeap} from '@memlab/core';\n\nclass TestObject {\n public arr1 = [1, 2, 3];\n public arr2 = ['1', '2', '3'];\n}\n\n(async function () {\n const obj = new TestObject();\n // get a heap snapshot of the current program state\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n const node = heap.getAnyObjectWithClassName('TestObject');\n console.log(node?.name); // should be 'TestObject'\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1473"},"core/src/lib/Types.ts:1473"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getnodebyidid"},(0,r.yg)("a",{id:"getnodebyid"}),(0,r.yg)("strong",{parentName:"h3"},"getNodeById"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"id"),")"),(0,r.yg)("p",null,"If you have the id of a heap node (JS object in heap), use this API\nto get an ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," associated with the id."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"id"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"number")," | id of the heap node (JS object in heap) you would like to query"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | the API returns ",(0,r.yg)("inlineCode",{parentName:"p"},"null")," if no heap object has the specified id.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n const node = heap.getNodeById(351);\n node?.id; // should be 351\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1354"},"core/src/lib/Types.ts:1354"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getnodesbyidsetids"},(0,r.yg)("a",{id:"getnodesbyidset"}),(0,r.yg)("strong",{parentName:"h3"},"getNodesByIdSet"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"ids"),")"),(0,r.yg)("p",null,"Given a set of ids of heap nodes (JS objects in heap), use this API\nto get a set of those heap nodes."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"ids"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Set"),"<",(0,r.yg)("inlineCode",{parentName:"li"},"number"),">"," | id set of the heap nodes (JS objects in heap) you would like to query"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"Set"),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | a set of those heap nodes. The set will only include\nnodes that are found in the heap. If none of the input ids are found,\nthis API will return an empty set.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // suppose 1000 is not a valid id in the heap\n const set = heap.getNodesByIdSet(new Set([1, 2, 1000, 3]));\n set // should be Set([node1, node2, node3])\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1406"},"core/src/lib/Types.ts:1406"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"getnodesbyidsids"},(0,r.yg)("a",{id:"getnodesbyids"}),(0,r.yg)("strong",{parentName:"h3"},"getNodesByIds"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"ids"),")"),(0,r.yg)("p",null,"Given an array of ids of heap nodes (JS objects in heap), use this API\nto get an array of those heap nodes."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"ids"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"number"),"[] | id array of the heap nodes (JS objects in heap) you would like to query"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,r.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,r.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">","[] | an array of those heap nodes. The return array will preserve the\norder of the input array. If an id is not found in the heap, the\ncorresponding element in the return array will be ",(0,r.yg)("inlineCode",{parentName:"p"},"null"),".")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // suppose 1000 is not a valid id in the heap\n const nodes = heap.getNodesByIds([1, 2, 1000, 3]);\n nodes // should be [node1, node2, null, node3]\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1380"},"core/src/lib/Types.ts:1380"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"hasobjectwithclassnameclassname"},(0,r.yg)("a",{id:"hasobjectwithclassname"}),(0,r.yg)("strong",{parentName:"h3"},"hasObjectWithClassName"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"className"),")"),(0,r.yg)("p",null,"Search for the heap and check if there is any JS object instance with\na specified constructor name."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"className"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | The constructor name of the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," | ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," if there is at least one such object in the heap")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),": you can write a jest unit test with memory assertions:"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"// save as example.test.ts\nimport type {IHeapSnapshot, Nullable} from '@memlab/core';\nimport {config, takeNodeMinimalHeap} from '@memlab/core';\n\nclass TestObject {\n public arr1 = [1, 2, 3];\n public arr2 = ['1', '2', '3'];\n}\n\ntest('memory test with heap assertion', async () => {\n config.muteConsole = true; // no console output\n\n let obj: Nullable = new TestObject();\n // get a heap snapshot of the current program state\n let heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n // call some function that may add references to obj\n rabbitHole(obj)\n\n expect(heap.hasObjectWithClassName('TestObject')).toBe(true);\n obj = null;\n\n heap = await takeNodeMinimalHeap();\n // if rabbitHole does not have any side effect that\n // adds new references to obj, then obj can be GCed\n expect(heap.hasObjectWithClassName('TestObject')).toBe(false);\n\n}, 30000);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1445"},"core/src/lib/Types.ts:1445"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"hasobjectwithpropertynamenameorindex"},(0,r.yg)("a",{id:"hasobjectwithpropertyname"}),(0,r.yg)("strong",{parentName:"h3"},"hasObjectWithPropertyName"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"nameOrIndex"),")"),(0,r.yg)("p",null,"Search for the heap and check if there is any JS object instance with\na specified property name."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"nameOrIndex"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," ","|"," ",(0,r.yg)("inlineCode",{parentName:"li"},"number")," | The property name (string) or element index (number) on the object instance"))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"p"},"boolean")," | returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," if there is at least one such object in the heap")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const object = {'memlab-test-heap-property': 'memlab-test-heap-value'};\n\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n // should be true\n console.log(heap.hasObjectWithPropertyName('memlab-test-heap-property'));\n})();\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1499"},"core/src/lib/Types.ts:1499"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"hasobjectwithtagtag"},(0,r.yg)("a",{id:"hasobjectwithtag"}),(0,r.yg)("strong",{parentName:"h3"},"hasObjectWithTag"),"(",(0,r.yg)("inlineCode",{parentName:"h3"},"tag"),")"),(0,r.yg)("p",null,"Search for the heap and check if there is any JS object instance with\na marker tagged by ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#tagobject"},"tagObject"),"."),(0,r.yg)("p",null,"The ",(0,r.yg)("inlineCode",{parentName:"p"},"tagObject")," API does not modify the object instance in any way\n(e.g., no additional or hidden properties added to the tagged object)."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Parameters"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"tag"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | marker name on the object instances tagged by ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#tagobject"},"tagObject")))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | returns ",(0,r.yg)("inlineCode",{parentName:"li"},"true")," if there is at least one such object in the heap")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, AnyValue} from '@memlab/core';\nimport {config, takeNodeMinimalHeap, tagObject} from '@memlab/core';\n\ntest('memory test', async () => {\n config.muteConsole = true;\n const o1: AnyValue = {};\n let o2: AnyValue = {};\n\n // tag o1 with marker: \"memlab-mark-1\", does not modify o1 in any way\n tagObject(o1, 'memlab-mark-1');\n // tag o2 with marker: \"memlab-mark-2\", does not modify o2 in any way\n tagObject(o2, 'memlab-mark-2');\n\n o2 = null;\n\n const heap: IHeapSnapshot = await takeNodeMinimalHeap();\n\n // expect object with marker \"memlab-mark-1\" exists\n expect(heap.hasObjectWithTag('memlab-mark-1')).toBe(true);\n\n // expect object with marker \"memlab-mark-2\" can be GCed\n expect(heap.hasObjectWithTag('memlab-mark-2')).toBe(false);\n\n}, 30000);\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1537"},"core/src/lib/Types.ts:1537"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/e012388a.04a3ce53.js b/assets/js/e012388a.ebe92a19.js similarity index 97% rename from assets/js/e012388a.04a3ce53.js rename to assets/js/e012388a.ebe92a19.js index 2fa976f2d..dae846616 100644 --- a/assets/js/e012388a.04a3ce53.js +++ b/assets/js/e012388a.ebe92a19.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8953],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var p=r.createContext({}),s=function(e){var a=r.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},c=function(e){var a=s(e.components);return r.createElement(p.Provider,{value:a},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},g=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,o=e.originalType,p=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),m=s(n),g=t,y=m["".concat(p,".").concat(g)]||m[g]||d[g]||o;return n?r.createElement(y,l(l({ref:a},c),{},{components:n})):r.createElement(y,l({ref:a},c))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var o=n.length,l=new Array(o);l[0]=g;var i={};for(var p in a)hasOwnProperty.call(a,p)&&(i[p]=a[p]);i.originalType=e,i[m]="string"==typeof e?e:t,l[1]=i;for(var s=2;s{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>s});var r=n(8168),t=(n(6540),n(5680));const o={id:"core_src.IHeapNodes",title:"Interface: IHeapNodes",sidebar_label:"IHeapNodes",custom_edit_url:null},l=void 0,i={unversionedId:"api/interfaces/core_src.IHeapNodes",id:"api/interfaces/core_src.IHeapNodes",title:"Interface: IHeapNodes",description:"A pseudo array containing all heap graph nodes (JS objects",source:"@site/docs/api/interfaces/core_src.IHeapNodes.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapNodes",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNodes",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapNodes",title:"Interface: IHeapNodes",sidebar_label:"IHeapNodes",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNode"},next:{title:"IHeapSnapshot",permalink:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"}},p={},s=[{value:"Properties",id:"properties",level:2},{value:' length: number',id:"-length-number",level:3},{value:"Methods",id:"methods",level:2},{value:'forEach(callback)',id:"foreachcallback",level:3},{value:'get(index)',id:"getindex",level:3}],c={toc:s},m="wrapper";function d(e){let{components:a,...n}=e;return(0,t.yg)(m,(0,r.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"A pseudo array containing all heap graph nodes (JS objects\nin heap). A JS heap could contain millions of objects, so memlab uses\na pseudo array as the collection of all the heap nodes. The pseudo\narray provides API to query and traverse all heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," modifying this pseudo array is not recommended"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNodes} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n const nodes: IHeapNodes = heap.nodes;\n nodes.length;\n nodes.get(0);\n nodes.forEach((node, i) => {\n if (stopIteration) {\n return false;\n }\n });\n})();\n")),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-length-number"},(0,t.yg)("a",{id:"length",name:"length"})," ",(0,t.yg)("strong",{parentName:"h3"},"length"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of nodes in heap graph (or JS objects in heap\nsnapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2263"},"core/src/lib/Types.ts:2263"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"foreachcallback"},(0,t.yg)("a",{id:"foreach"}),(0,t.yg)("strong",{parentName:"h3"},"forEach"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"Iterate over all array elements and apply the callback\nto each element in ascending order of element index."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),", ",(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number"),") => ",(0,t.yg)("inlineCode",{parentName:"li"},"boolean")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"void")," | the callback does not need to return any value, if the callback returns ",(0,t.yg)("inlineCode",{parentName:"li"},"false")," when iterating on element at index ",(0,t.yg)("inlineCode",{parentName:"li"},"i"),", then all elements after ",(0,t.yg)("inlineCode",{parentName:"li"},"i")," won't be iterated."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2279"},"core/src/lib/Types.ts:2279"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getindex"},(0,t.yg)("a",{id:"get"}),(0,t.yg)("strong",{parentName:"h3"},"get"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"index"),")"),(0,t.yg)("p",null,"get an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," element at the specified index"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the index of an element in the pseudo array, the index ranges from 0 to array length - 1. Notice that this is not the heap node id."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | When 0 <= ",(0,t.yg)("inlineCode",{parentName:"p"},"index")," < array.length, this API returns the element\nat the specified index, otherwise it returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null"),".")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L2271"},"core/src/lib/Types.ts:2271"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8953],{5680:(e,a,n)=>{n.d(a,{xA:()=>c,yg:()=>y});var r=n(6540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var p=r.createContext({}),s=function(e){var a=r.useContext(p),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},c=function(e){var a=s(e.components);return r.createElement(p.Provider,{value:a},e.children)},m="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return r.createElement(r.Fragment,{},a)}},g=r.forwardRef((function(e,a){var n=e.components,t=e.mdxType,o=e.originalType,p=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),m=s(n),g=t,y=m["".concat(p,".").concat(g)]||m[g]||d[g]||o;return n?r.createElement(y,l(l({ref:a},c),{},{components:n})):r.createElement(y,l({ref:a},c))}));function y(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var o=n.length,l=new Array(o);l[0]=g;var i={};for(var p in a)hasOwnProperty.call(a,p)&&(i[p]=a[p]);i.originalType=e,i[m]="string"==typeof e?e:t,l[1]=i;for(var s=2;s{n.r(a),n.d(a,{assets:()=>p,contentTitle:()=>l,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>s});var r=n(8168),t=(n(6540),n(5680));const o={id:"core_src.IHeapNodes",title:"Interface: IHeapNodes",sidebar_label:"IHeapNodes",custom_edit_url:null},l=void 0,i={unversionedId:"api/interfaces/core_src.IHeapNodes",id:"api/interfaces/core_src.IHeapNodes",title:"Interface: IHeapNodes",description:"A pseudo array containing all heap graph nodes (JS objects",source:"@site/docs/api/interfaces/core_src.IHeapNodes.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IHeapNodes",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNodes",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IHeapNodes",title:"Interface: IHeapNodes",sidebar_label:"IHeapNodes",custom_edit_url:null},sidebar:"sidebar",previous:{title:"IHeapNode",permalink:"/memlab/docs/api/interfaces/core_src.IHeapNode"},next:{title:"IHeapSnapshot",permalink:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"}},p={},s=[{value:"Properties",id:"properties",level:2},{value:' length: number',id:"-length-number",level:3},{value:"Methods",id:"methods",level:2},{value:'forEach(callback)',id:"foreachcallback",level:3},{value:'get(index)',id:"getindex",level:3}],c={toc:s},m="wrapper";function d(e){let{components:a,...n}=e;return(0,t.yg)(m,(0,r.A)({},c,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("p",null,"A pseudo array containing all heap graph nodes (JS objects\nin heap). A JS heap could contain millions of objects, so memlab uses\na pseudo array as the collection of all the heap nodes. The pseudo\narray provides API to query and traverse all heap objects."),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},(0,t.yg)("inlineCode",{parentName:"strong"},"readonly"))," modifying this pseudo array is not recommended"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Examples"),":")),(0,t.yg)("pre",null,(0,t.yg)("code",{parentName:"pre",className:"language-typescript"},"import type {IHeapSnapshot, IHeapNodes} from '@memlab/core';\nimport {dumpNodeHeapSnapshot} from '@memlab/core';\nimport {getFullHeapFromFile} from '@memlab/heap-analysis';\n\n(async function () {\n const heapFile = dumpNodeHeapSnapshot();\n const heap: IHeapSnapshot = await getFullHeapFromFile(heapFile);\n\n const nodes: IHeapNodes = heap.nodes;\n nodes.length;\n nodes.get(0);\n nodes.forEach((node, i) => {\n if (stopIteration) {\n return false;\n }\n });\n})();\n")),(0,t.yg)("h2",{id:"properties"},"Properties"),(0,t.yg)("h3",{id:"-length-number"},(0,t.yg)("a",{id:"length",name:"length"})," ",(0,t.yg)("strong",{parentName:"h3"},"length"),": ",(0,t.yg)("inlineCode",{parentName:"h3"},"number")),(0,t.yg)("p",null,"The total number of nodes in heap graph (or JS objects in heap\nsnapshot)."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2263"},"core/src/lib/Types.ts:2263"))))),(0,t.yg)("h2",{id:"methods"},"Methods"),(0,t.yg)("h3",{id:"foreachcallback"},(0,t.yg)("a",{id:"foreach"}),(0,t.yg)("strong",{parentName:"h3"},"forEach"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"callback"),")"),(0,t.yg)("p",null,"Iterate over all array elements and apply the callback\nto each element in ascending order of element index."),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Parameters"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"callback"),": (",(0,t.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,t.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),", ",(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number"),") => ",(0,t.yg)("inlineCode",{parentName:"li"},"boolean")," ","|"," ",(0,t.yg)("inlineCode",{parentName:"li"},"void")," | the callback does not need to return any value, if the callback returns ",(0,t.yg)("inlineCode",{parentName:"li"},"false")," when iterating on element at index ",(0,t.yg)("inlineCode",{parentName:"li"},"i"),", then all elements after ",(0,t.yg)("inlineCode",{parentName:"li"},"i")," won't be iterated."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Returns"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"void")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("strong",{parentName:"li"},"Source"),":",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2279"},"core/src/lib/Types.ts:2279"))))),(0,t.yg)("hr",null),(0,t.yg)("h3",{id:"getindex"},(0,t.yg)("a",{id:"get"}),(0,t.yg)("strong",{parentName:"h3"},"get"),"(",(0,t.yg)("inlineCode",{parentName:"h3"},"index"),")"),(0,t.yg)("p",null,"get an ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode")," element at the specified index"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"index"),": ",(0,t.yg)("inlineCode",{parentName:"li"},"number")," | the index of an element in the pseudo array, the index ranges from 0 to array length - 1. Notice that this is not the heap node id."))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Returns"),": ",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/core_src#nullable"},(0,t.yg)("inlineCode",{parentName:"a"},"Nullable")),"<",(0,t.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},(0,t.yg)("inlineCode",{parentName:"a"},"IHeapNode")),">"," | When 0 <= ",(0,t.yg)("inlineCode",{parentName:"p"},"index")," < array.length, this API returns the element\nat the specified index, otherwise it returns ",(0,t.yg)("inlineCode",{parentName:"p"},"null"),".")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"Source"),":"),(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L2271"},"core/src/lib/Types.ts:2271"))))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/e4c6f3cc.4faa71dc.js b/assets/js/e4c6f3cc.6d8da579.js similarity index 97% rename from assets/js/e4c6f3cc.4faa71dc.js rename to assets/js/e4c6f3cc.6d8da579.js index c699a8d8e..8de981151 100644 --- a/assets/js/e4c6f3cc.4faa71dc.js +++ b/assets/js/e4c6f3cc.6d8da579.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9600],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},h=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,r=e.originalType,o=e.parentName,y=i(e,["components","mdxType","originalType","parentName"]),u=p(n),h=s,g=u["".concat(o,".").concat(h)]||u[h]||c[h]||r;return n?t.createElement(g,l(l({ref:a},y),{},{components:n})):t.createElement(g,l({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var r=n.length,l=new Array(r);l[0]=h;var i={};for(var o in a)hasOwnProperty.call(a,o)&&(i[o]=a[o]);i.originalType=e,i[u]="string"==typeof e?e:s,l[1]=i;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>l,default:()=>c,frontMatter:()=>r,metadata:()=>i,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const r={id:"heap_analysis_src.ShapeUnboundGrowthAnalysis",title:"Class: ShapeUnboundGrowthAnalysis",sidebar_label:"ShapeUnboundGrowthAnalysis",custom_edit_url:null},l=void 0,i={unversionedId:"api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",id:"api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",title:"Class: ShapeUnboundGrowthAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ShapeUnboundGrowthAnalysis",title:"Class: ShapeUnboundGrowthAnalysis",sidebar_label:"ShapeUnboundGrowthAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"},next:{title:"StringAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ShapeUnboundGrowthAnalysis()',id:"new-shapeunboundgrowthanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotsInDirectory(directory, options?)',id:"analyzesnapshotsindirectorydirectory-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getShapesWithUnboundGrowth()',id:"getshapeswithunboundgrowth",level:3}],y={toc:p},u="wrapper";function c(e){let{components:a,...n}=e;return(0,s.yg)(u,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ShapeUnboundGrowthAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-shapeunboundgrowthanalysis"},(0,s.yg)("a",{id:"new shapeunboundgrowthanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ShapeUnboundGrowthAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotsindirectorydirectory-options"},(0,s.yg)("a",{id:"analyzesnapshotsindirectory"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotsInDirectory"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"directory"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a series of heap snapshot files"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"directory"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory holding a series of ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," files, all snapshot files will be loaded and analyzed in the alphanumerically ascending order of those snapshot file names."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory);\n// query analysis-specific and structured results\nconst shapes = analysis.getShapesWithUnboundGrowth();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L148"},"heap-analysis/src/BaseAnalysis.ts:148"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts#L43"},"heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts:43"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getshapeswithunboundgrowth"},(0,s.yg)("a",{id:"getshapeswithunboundgrowth"}),(0,s.yg)("strong",{parentName:"h3"},"getShapesWithUnboundGrowth"),"()"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"ShapeSummary"),"[]"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts#L71"},"heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts:71"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9600],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function r(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function l(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):l(l({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},u="mdxType",c={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},h=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,r=e.originalType,o=e.parentName,y=i(e,["components","mdxType","originalType","parentName"]),u=p(n),h=s,g=u["".concat(o,".").concat(h)]||u[h]||c[h]||r;return n?t.createElement(g,l(l({ref:a},y),{},{components:n})):t.createElement(g,l({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var r=n.length,l=new Array(r);l[0]=h;var i={};for(var o in a)hasOwnProperty.call(a,o)&&(i[o]=a[o]);i.originalType=e,i[u]="string"==typeof e?e:s,l[1]=i;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>l,default:()=>c,frontMatter:()=>r,metadata:()=>i,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const r={id:"heap_analysis_src.ShapeUnboundGrowthAnalysis",title:"Class: ShapeUnboundGrowthAnalysis",sidebar_label:"ShapeUnboundGrowthAnalysis",custom_edit_url:null},l=void 0,i={unversionedId:"api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",id:"api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",title:"Class: ShapeUnboundGrowthAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ShapeUnboundGrowthAnalysis",title:"Class: ShapeUnboundGrowthAnalysis",sidebar_label:"ShapeUnboundGrowthAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ObjectUnboundGrowthAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis"},next:{title:"StringAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ShapeUnboundGrowthAnalysis()',id:"new-shapeunboundgrowthanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotsInDirectory(directory, options?)',id:"analyzesnapshotsindirectorydirectory-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3},{value:'getShapesWithUnboundGrowth()',id:"getshapeswithunboundgrowth",level:3}],y={toc:p},u="wrapper";function c(e){let{components:a,...n}=e;return(0,s.yg)(u,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ShapeUnboundGrowthAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-shapeunboundgrowthanalysis"},(0,s.yg)("a",{id:"new shapeunboundgrowthanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ShapeUnboundGrowthAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotsindirectorydirectory-options"},(0,s.yg)("a",{id:"analyzesnapshotsindirectory"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotsInDirectory"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"directory"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a series of heap snapshot files"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"directory"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory holding a series of ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," files, all snapshot files will be loaded and analyzed in the alphanumerically ascending order of those snapshot file names."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory);\n// query analysis-specific and structured results\nconst shapes = analysis.getShapesWithUnboundGrowth();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new ShapeUnboundGrowthAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotsInDirectory(snapshotDirectory, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L148"},"heap-analysis/src/BaseAnalysis.ts:148"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts#L43"},"heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts:43"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getshapeswithunboundgrowth"},(0,s.yg)("a",{id:"getshapeswithunboundgrowth"}),(0,s.yg)("strong",{parentName:"h3"},"getShapesWithUnboundGrowth"),"()"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"ShapeSummary"),"[]"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts#L71"},"heap-analysis/src/plugins/ShapeUnboundGrowthAnalysis.ts:71"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f40f92ec.84c854af.js b/assets/js/f40f92ec.10161c85.js similarity index 93% rename from assets/js/f40f92ec.84c854af.js rename to assets/js/f40f92ec.10161c85.js index 505e0adb1..b9819be36 100644 --- a/assets/js/f40f92ec.84c854af.js +++ b/assets/js/f40f92ec.10161c85.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[346],{5680:(e,t,a)=>{a.d(t,{xA:()=>u,yg:()=>y});var r=a(6540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function s(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var i=r.createContext({}),p=function(e){var t=r.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},u=function(e){var t=p(e.components);return r.createElement(i.Provider,{value:t},e.children)},c="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,i=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),c=p(a),m=n,y=c["".concat(i,".").concat(m)]||c[m]||g[m]||l;return a?r.createElement(y,s(s({ref:t},u),{},{components:a})):r.createElement(y,s({ref:t},u))}));function y(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,s=new Array(l);s[0]=m;var o={};for(var i in t)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o[c]="string"==typeof e?e:n,s[1]=o;for(var p=2;p{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>s,default:()=>g,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var r=a(8168),n=(a(6540),a(5680));const l={id:"api_src.BrowserInteractionResultReader",title:"Class: BrowserInteractionResultReader",sidebar_label:"BrowserInteractionResultReader",custom_edit_url:null},s=void 0,o={unversionedId:"api/classes/api_src.BrowserInteractionResultReader",id:"api/classes/api_src.BrowserInteractionResultReader",title:"Class: BrowserInteractionResultReader",description:"A utility entity to read all generated files from",source:"@site/docs/api/classes/api_src.BrowserInteractionResultReader.md",sourceDirName:"api/classes",slug:"/api/classes/api_src.BrowserInteractionResultReader",permalink:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"api_src.BrowserInteractionResultReader",title:"Class: BrowserInteractionResultReader",sidebar_label:"BrowserInteractionResultReader",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ConsoleMode",permalink:"/memlab/docs/api/enums/api_src.ConsoleMode"},next:{title:"SnapshotResultReader",permalink:"/memlab/docs/api/classes/api_src.SnapshotResultReader"}},i={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Methods",id:"methods",level:2},{value:'cleanup()',id:"cleanup",level:3},{value:'getConsoleBackupFile()',id:"getconsolebackupfile",level:3},{value:'getInteractionSteps()',id:"getinteractionsteps",level:3},{value:'getRootDirectory()',id:"getrootdirectory",level:3},{value:'getRunMetaInfo()',id:"getrunmetainfo",level:3},{value:'getSnapshotFileDir()',id:"getsnapshotfiledir",level:3},{value:'getSnapshotFiles()',id:"getsnapshotfiles",level:3},{value:'Static from(workDir?)',id:"static-fromworkdir",level:3}],u={toc:p},c="wrapper";function g(e){let{components:t,...a}=e;return(0,n.yg)(c,(0,r.A)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("p",null,"A utility entity to read all generated files from\nthe directory holding the data and results from the\nlast MemLab browser interaction run"),(0,n.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("inlineCode",{parentName:"p"},"default")),(0,n.yg)("p",{parentName:"li"},"\u21b3 ",(0,n.yg)("strong",{parentName:"p"},(0,n.yg)("inlineCode",{parentName:"strong"},"BrowserInteractionResultReader"))))),(0,n.yg)("h2",{id:"methods"},"Methods"),(0,n.yg)("h3",{id:"cleanup"},(0,n.yg)("a",{id:"cleanup"}),(0,n.yg)("strong",{parentName:"h3"},"cleanup"),"()"),(0,n.yg)("p",null,"clean up data/files generated from the memlab browser interaction run"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"void")," | no return value"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // delete all data/files generated by takeSnapshots\n result.cleanup();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BaseResultReader.ts#L122"},"api/src/result-reader/BaseResultReader.ts:122"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getconsolebackupfile"},(0,n.yg)("a",{id:"getconsolebackupfile"}),(0,n.yg)("strong",{parentName:"h3"},"getConsoleBackupFile"),"()"),(0,n.yg)("p",null,"This method gets the backup file of the console output."),(0,n.yg)("p",null,"The memlab CLI commands (e.g., ",(0,n.yg)("inlineCode",{parentName:"p"},"memlab find-leaks"),") outputs a\nnon-structured string representation for easy reading, while the\nAPIs (e.g., ",(0,n.yg)("code",null,(0,n.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#findleaks"},"findLeaks")),") return structured leaks\nrepresentation that is handy for post-processing. If you need to\nobtain all the string output from the CLI in the current working directory,\nyou can read them from the CLI output backup file returned by this method."),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the backup file"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots, findLeaks} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n const leaks = await findLeaks(result);\n\n // get the console output backup file\n const consoleBackupFile = result.getConsoleBackupFile();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BaseResultReader.ts#L102"},"api/src/result-reader/BaseResultReader.ts:102"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getinteractionsteps"},(0,n.yg)("a",{id:"getinteractionsteps"}),(0,n.yg)("strong",{parentName:"h3"},"getInteractionSteps"),"()"),(0,n.yg)("p",null,"browser interaction step sequence"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"E2EStepInfo"),"[] | an array of browser interaction step information"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n const steps = result.getInteractionSteps();\n // print each browser interaction's name and JavaScript heap size (in bytes)\n steps.forEach(step => console.log(step.name, step.JSHeapUsedSize))\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L106"},"api/src/result-reader/BrowserInteractionResultReader.ts:106"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getrootdirectory"},(0,n.yg)("a",{id:"getrootdirectory"}),(0,n.yg)("strong",{parentName:"h3"},"getRootDirectory"),"()"),(0,n.yg)("p",null,"get the directory where the data and generated files of\nthe memlab run were stored"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | absolute path of the directory"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get the directory that stores all the files\n // generated from the takeSnapshots call\n const dataDir = result.getRootDirectory();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BaseResultReader.ts#L72"},"api/src/result-reader/BaseResultReader.ts:72"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getrunmetainfo"},(0,n.yg)("a",{id:"getrunmetainfo"}),(0,n.yg)("strong",{parentName:"h3"},"getRunMetaInfo"),"()"),(0,n.yg)("p",null,"general meta data of the browser interaction run"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"RunMetaInfo")," | meta data about the entire browser interaction"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n const metaInfo = result.getRunMetaInfo();\n // print all browser web console output\n console.log(metaInfo.browserInfo._consoleMessages.join('\\n'));\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L131"},"api/src/result-reader/BrowserInteractionResultReader.ts:131"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getsnapshotfiledir"},(0,n.yg)("a",{id:"getsnapshotfiledir"}),(0,n.yg)("strong",{parentName:"h3"},"getSnapshotFileDir"),"()"),(0,n.yg)("p",null,"get the directory holding all snapshot files"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get the absolute path the directory holding all snapshot files\n const files = result.getSnapshotFileDir();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L84"},"api/src/result-reader/BrowserInteractionResultReader.ts:84"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getsnapshotfiles"},(0,n.yg)("a",{id:"getsnapshotfiles"}),(0,n.yg)("strong",{parentName:"h3"},"getSnapshotFiles"),"()"),(0,n.yg)("p",null,"get all snapshot files generated from last memlab browser interaction"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string"),"[] | an array of snapshot file's absolute path"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get absolute paths of all snapshot files\n const files = result.getSnapshotFiles();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L59"},"api/src/result-reader/BrowserInteractionResultReader.ts:59"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"static-fromworkdir"},(0,n.yg)("a",{id:"from"}),(0,n.yg)("inlineCode",{parentName:"h3"},"Static")," ",(0,n.yg)("strong",{parentName:"h3"},"from"),"(",(0,n.yg)("inlineCode",{parentName:"h3"},"workDir?"),")"),(0,n.yg)("p",null,"build a result reader from a data directory where the data\nand generated files of a memlab run were stored"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("inlineCode",{parentName:"li"},"workDir"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | ",(0,n.yg)("inlineCode",{parentName:"li"},"''")," | absolute path of the data directory"))),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("strong",{parentName:"p"},"Returns"),": ",(0,n.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,n.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader"))," | the ResultReader instance")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {BrowserInteractionResultReader} = require('@memlab/api');\n\nconst dataDir = '/tmp/memlab'; // where the last memlab run stores results\nconst reader = BrowserInteractionResultReader.from(dataDir);\nreader.cleanup(); // clean up the results\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L39"},"api/src/result-reader/BrowserInteractionResultReader.ts:39"))))))}g.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[346],{5680:(e,t,a)=>{a.d(t,{xA:()=>u,yg:()=>y});var r=a(6540);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function s(e){for(var t=1;t=0||(n[a]=e[a]);return n}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(n[a]=e[a])}return n}var i=r.createContext({}),p=function(e){var t=r.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):s(s({},t),e)),a},u=function(e){var t=p(e.components);return r.createElement(i.Provider,{value:t},e.children)},g="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},m=r.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,i=e.parentName,u=o(e,["components","mdxType","originalType","parentName"]),g=p(a),m=n,y=g["".concat(i,".").concat(m)]||g[m]||c[m]||l;return a?r.createElement(y,s(s({ref:t},u),{},{components:a})):r.createElement(y,s({ref:t},u))}));function y(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,s=new Array(l);s[0]=m;var o={};for(var i in t)hasOwnProperty.call(t,i)&&(o[i]=t[i]);o.originalType=e,o[g]="string"==typeof e?e:n,s[1]=o;for(var p=2;p{a.r(t),a.d(t,{assets:()=>i,contentTitle:()=>s,default:()=>c,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var r=a(8168),n=(a(6540),a(5680));const l={id:"api_src.BrowserInteractionResultReader",title:"Class: BrowserInteractionResultReader",sidebar_label:"BrowserInteractionResultReader",custom_edit_url:null},s=void 0,o={unversionedId:"api/classes/api_src.BrowserInteractionResultReader",id:"api/classes/api_src.BrowserInteractionResultReader",title:"Class: BrowserInteractionResultReader",description:"A utility entity to read all generated files from",source:"@site/docs/api/classes/api_src.BrowserInteractionResultReader.md",sourceDirName:"api/classes",slug:"/api/classes/api_src.BrowserInteractionResultReader",permalink:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"api_src.BrowserInteractionResultReader",title:"Class: BrowserInteractionResultReader",sidebar_label:"BrowserInteractionResultReader",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ConsoleMode",permalink:"/memlab/docs/api/enums/api_src.ConsoleMode"},next:{title:"SnapshotResultReader",permalink:"/memlab/docs/api/classes/api_src.SnapshotResultReader"}},i={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Methods",id:"methods",level:2},{value:'cleanup()',id:"cleanup",level:3},{value:'getConsoleBackupFile()',id:"getconsolebackupfile",level:3},{value:'getInteractionSteps()',id:"getinteractionsteps",level:3},{value:'getRootDirectory()',id:"getrootdirectory",level:3},{value:'getRunMetaInfo()',id:"getrunmetainfo",level:3},{value:'getSnapshotFileDir()',id:"getsnapshotfiledir",level:3},{value:'getSnapshotFiles()',id:"getsnapshotfiles",level:3},{value:'Static from(workDir?)',id:"static-fromworkdir",level:3}],u={toc:p},g="wrapper";function c(e){let{components:t,...a}=e;return(0,n.yg)(g,(0,r.A)({},u,a,{components:t,mdxType:"MDXLayout"}),(0,n.yg)("p",null,"A utility entity to read all generated files from\nthe directory holding the data and results from the\nlast MemLab browser interaction run"),(0,n.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("inlineCode",{parentName:"p"},"default")),(0,n.yg)("p",{parentName:"li"},"\u21b3 ",(0,n.yg)("strong",{parentName:"p"},(0,n.yg)("inlineCode",{parentName:"strong"},"BrowserInteractionResultReader"))))),(0,n.yg)("h2",{id:"methods"},"Methods"),(0,n.yg)("h3",{id:"cleanup"},(0,n.yg)("a",{id:"cleanup"}),(0,n.yg)("strong",{parentName:"h3"},"cleanup"),"()"),(0,n.yg)("p",null,"clean up data/files generated from the memlab browser interaction run"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"void")," | no return value"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // delete all data/files generated by takeSnapshots\n result.cleanup();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BaseResultReader.ts#L122"},"api/src/result-reader/BaseResultReader.ts:122"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getconsolebackupfile"},(0,n.yg)("a",{id:"getconsolebackupfile"}),(0,n.yg)("strong",{parentName:"h3"},"getConsoleBackupFile"),"()"),(0,n.yg)("p",null,"This method gets the backup file of the console output."),(0,n.yg)("p",null,"The memlab CLI commands (e.g., ",(0,n.yg)("inlineCode",{parentName:"p"},"memlab find-leaks"),") outputs a\nnon-structured string representation for easy reading, while the\nAPIs (e.g., ",(0,n.yg)("code",null,(0,n.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#findleaks"},"findLeaks")),") return structured leaks\nrepresentation that is handy for post-processing. If you need to\nobtain all the string output from the CLI in the current working directory,\nyou can read them from the CLI output backup file returned by this method."),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the backup file"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots, findLeaks} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n const leaks = await findLeaks(result);\n\n // get the console output backup file\n const consoleBackupFile = result.getConsoleBackupFile();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BaseResultReader.ts#L102"},"api/src/result-reader/BaseResultReader.ts:102"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getinteractionsteps"},(0,n.yg)("a",{id:"getinteractionsteps"}),(0,n.yg)("strong",{parentName:"h3"},"getInteractionSteps"),"()"),(0,n.yg)("p",null,"browser interaction step sequence"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"E2EStepInfo"),"[] | an array of browser interaction step information"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n const steps = result.getInteractionSteps();\n // print each browser interaction's name and JavaScript heap size (in bytes)\n steps.forEach(step => console.log(step.name, step.JSHeapUsedSize))\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L106"},"api/src/result-reader/BrowserInteractionResultReader.ts:106"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getrootdirectory"},(0,n.yg)("a",{id:"getrootdirectory"}),(0,n.yg)("strong",{parentName:"h3"},"getRootDirectory"),"()"),(0,n.yg)("p",null,"get the directory where the data and generated files of\nthe memlab run were stored"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | absolute path of the directory"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get the directory that stores all the files\n // generated from the takeSnapshots call\n const dataDir = result.getRootDirectory();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BaseResultReader.ts#L72"},"api/src/result-reader/BaseResultReader.ts:72"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getrunmetainfo"},(0,n.yg)("a",{id:"getrunmetainfo"}),(0,n.yg)("strong",{parentName:"h3"},"getRunMetaInfo"),"()"),(0,n.yg)("p",null,"general meta data of the browser interaction run"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"RunMetaInfo")," | meta data about the entire browser interaction"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n const metaInfo = result.getRunMetaInfo();\n // print all browser web console output\n console.log(metaInfo.browserInfo._consoleMessages.join('\\n'));\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L131"},"api/src/result-reader/BrowserInteractionResultReader.ts:131"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getsnapshotfiledir"},(0,n.yg)("a",{id:"getsnapshotfiledir"}),(0,n.yg)("strong",{parentName:"h3"},"getSnapshotFileDir"),"()"),(0,n.yg)("p",null,"get the directory holding all snapshot files"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of the directory"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get the absolute path the directory holding all snapshot files\n const files = result.getSnapshotFileDir();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L84"},"api/src/result-reader/BrowserInteractionResultReader.ts:84"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"getsnapshotfiles"},(0,n.yg)("a",{id:"getsnapshotfiles"}),(0,n.yg)("strong",{parentName:"h3"},"getSnapshotFiles"),"()"),(0,n.yg)("p",null,"get all snapshot files generated from last memlab browser interaction"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Returns"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string"),"[] | an array of snapshot file's absolute path"),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Examples"),":")),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {takeSnapshots} = require('@memlab/api');\n\n(async function () {\n const scenario = { url: () => 'https://www.npmjs.com'};\n const result = await takeSnapshots({scenario});\n\n // get absolute paths of all snapshot files\n const files = result.getSnapshotFiles();\n})();\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L59"},"api/src/result-reader/BrowserInteractionResultReader.ts:59"))))),(0,n.yg)("hr",null),(0,n.yg)("h3",{id:"static-fromworkdir"},(0,n.yg)("a",{id:"from"}),(0,n.yg)("inlineCode",{parentName:"h3"},"Static")," ",(0,n.yg)("strong",{parentName:"h3"},"from"),"(",(0,n.yg)("inlineCode",{parentName:"h3"},"workDir?"),")"),(0,n.yg)("p",null,"build a result reader from a data directory where the data\nand generated files of a memlab run were stored"),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("inlineCode",{parentName:"li"},"workDir"),": ",(0,n.yg)("inlineCode",{parentName:"li"},"string")," | ",(0,n.yg)("inlineCode",{parentName:"li"},"''")," | absolute path of the data directory"))),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("strong",{parentName:"p"},"Returns"),": ",(0,n.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader"},(0,n.yg)("inlineCode",{parentName:"a"},"BrowserInteractionResultReader"))," | the ResultReader instance")),(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("p",{parentName:"li"},(0,n.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,n.yg)("pre",null,(0,n.yg)("code",{parentName:"pre",className:"language-javascript"},"const {BrowserInteractionResultReader} = require('@memlab/api');\n\nconst dataDir = '/tmp/memlab'; // where the last memlab run stores results\nconst reader = BrowserInteractionResultReader.from(dataDir);\nreader.cleanup(); // clean up the results\n")),(0,n.yg)("ul",null,(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("strong",{parentName:"li"},"Source"),":",(0,n.yg)("ul",{parentName:"li"},(0,n.yg)("li",{parentName:"ul"},(0,n.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/api/src/result-reader/BrowserInteractionResultReader.ts#L39"},"api/src/result-reader/BrowserInteractionResultReader.ts:39"))))))}c.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f8599c11.f4fd2a5c.js b/assets/js/f8599c11.a86b69ff.js similarity index 97% rename from assets/js/f8599c11.f4fd2a5c.js rename to assets/js/f8599c11.a86b69ff.js index bd28b540c..5b89ba6af 100644 --- a/assets/js/f8599c11.f4fd2a5c.js +++ b/assets/js/f8599c11.a86b69ff.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[233],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),m=s,g=c["".concat(o,".").concat(m)]||c[m]||u[m]||l;return n?t.createElement(g,i(i({ref:a},y),{},{components:n})):t.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var l=n.length,i=new Array(l);i[0]=m;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const l={id:"heap_analysis_src.ObjectFanoutAnalysis",title:"Class: ObjectFanoutAnalysis",sidebar_label:"ObjectFanoutAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectFanoutAnalysis",id:"api/classes/heap_analysis_src.ObjectFanoutAnalysis",title:"Class: ObjectFanoutAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectFanoutAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectFanoutAnalysis",title:"Class: ObjectFanoutAnalysis",sidebar_label:"ObjectFanoutAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"GlobalVariableAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"},next:{title:"ObjectShallowAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectFanoutAnalysis()',id:"new-objectfanoutanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function u(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ObjectFanoutAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-objectfanoutanalysis"},(0,s.yg)("a",{id:"new objectfanoutanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ObjectFanoutAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/heap-analysis/src/plugins/ObjectFanoutAnalysis.ts#L22"},"heap-analysis/src/plugins/ObjectFanoutAnalysis.ts:22"))))))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[233],{5680:(e,a,n)=>{n.d(a,{xA:()=>y,yg:()=>g});var t=n(6540);function s(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(s[n]=e[n]);return s}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}var o=t.createContext({}),p=function(e){var a=t.useContext(o),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},y=function(e){var a=p(e.components);return t.createElement(o.Provider,{value:a},e.children)},c="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},m=t.forwardRef((function(e,a){var n=e.components,s=e.mdxType,l=e.originalType,o=e.parentName,y=r(e,["components","mdxType","originalType","parentName"]),c=p(n),m=s,g=c["".concat(o,".").concat(m)]||c[m]||u[m]||l;return n?t.createElement(g,i(i({ref:a},y),{},{components:n})):t.createElement(g,i({ref:a},y))}));function g(e,a){var n=arguments,s=a&&a.mdxType;if("string"==typeof e||s){var l=n.length,i=new Array(l);i[0]=m;var r={};for(var o in a)hasOwnProperty.call(a,o)&&(r[o]=a[o]);r.originalType=e,r[c]="string"==typeof e?e:s,i[1]=r;for(var p=2;p{n.r(a),n.d(a,{assets:()=>o,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>r,toc:()=>p});var t=n(8168),s=(n(6540),n(5680));const l={id:"heap_analysis_src.ObjectFanoutAnalysis",title:"Class: ObjectFanoutAnalysis",sidebar_label:"ObjectFanoutAnalysis",custom_edit_url:null},i=void 0,r={unversionedId:"api/classes/heap_analysis_src.ObjectFanoutAnalysis",id:"api/classes/heap_analysis_src.ObjectFanoutAnalysis",title:"Class: ObjectFanoutAnalysis",description:"Hierarchy",source:"@site/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis.md",sourceDirName:"api/classes",slug:"/api/classes/heap_analysis_src.ObjectFanoutAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"heap_analysis_src.ObjectFanoutAnalysis",title:"Class: ObjectFanoutAnalysis",sidebar_label:"ObjectFanoutAnalysis",custom_edit_url:null},sidebar:"sidebar",previous:{title:"GlobalVariableAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis"},next:{title:"ObjectShallowAnalysis",permalink:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis"}},o={},p=[{value:"Hierarchy",id:"hierarchy",level:2},{value:"Constructors",id:"constructors",level:2},{value:'new ObjectFanoutAnalysis()',id:"new-objectfanoutanalysis",level:3},{value:"Methods",id:"methods",level:2},{value:'analyzeSnapshotFromFile(file, options?)',id:"analyzesnapshotfromfilefile-options",level:3},{value:'getCommandName()',id:"getcommandname",level:3}],y={toc:p},c="wrapper";function u(e){let{components:a,...n}=e;return(0,s.yg)(c,(0,t.A)({},y,n,{components:a,mdxType:"MDXLayout"}),(0,s.yg)("h2",{id:"hierarchy"},"Hierarchy"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("p",{parentName:"li"},(0,s.yg)("a",{parentName:"p",href:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis"},(0,s.yg)("inlineCode",{parentName:"a"},"BaseAnalysis"))),(0,s.yg)("p",{parentName:"li"},"\u21b3 ",(0,s.yg)("strong",{parentName:"p"},(0,s.yg)("inlineCode",{parentName:"strong"},"ObjectFanoutAnalysis"))))),(0,s.yg)("h2",{id:"constructors"},"Constructors"),(0,s.yg)("h3",{id:"new-objectfanoutanalysis"},(0,s.yg)("a",{id:"new objectfanoutanalysis"}),(0,s.yg)("strong",{parentName:"h3"},"new ObjectFanoutAnalysis"),"()"),(0,s.yg)("h2",{id:"methods"},"Methods"),(0,s.yg)("h3",{id:"analyzesnapshotfromfilefile-options"},(0,s.yg)("a",{id:"analyzesnapshotfromfile"}),(0,s.yg)("strong",{parentName:"h3"},"analyzeSnapshotFromFile"),"(",(0,s.yg)("inlineCode",{parentName:"h3"},"file"),", ",(0,s.yg)("inlineCode",{parentName:"h3"},"options?"),")"),(0,s.yg)("p",null,"Run heap analysis for a single heap snapshot file"),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Parameters"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"file"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the absolute path of a ",(0,s.yg)("inlineCode",{parentName:"li"},".heapsnapshot")," file."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("inlineCode",{parentName:"li"},"options"),": ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#runheapanalysisoptions"},(0,s.yg)("inlineCode",{parentName:"a"},"RunHeapAnalysisOptions"))," | optional configuration for the heap analysis run"))),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"Promise"),"<",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},(0,s.yg)("inlineCode",{parentName:"a"},"AnalyzeSnapshotResult")),">"," | this API returns ",(0,s.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/heap_analysis_src#analyzesnapshotresult"},"AnalyzeSnapshotResult"),", which contains\nthe logging file of analysis console output. Alternatively, to get more\nstructured analysis results, check out the documentation of the hosting\nheap analysis class and call the analysis-specific API to get results\nafter calling this method."),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Example"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile);\n// query analysis-specific and structured results\nconst stringPatterns = analysis.getTopDuplicatedStringsInCount();\n")),(0,s.yg)("p",null,"Additionally, you can specify a working directory to where\nthe intermediate, logging, and final output files will be dumped:"),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new StringAnalysis();\n// analysis console output is saved in result.analysisOutputFile\n// which is inside the specified working directory\nconst result = await analysis.analyzeSnapshotFromFile(snapshotFile, {\n // if the specified directory doesn't exist, memlab will create it\n workDir: '/tmp/your/work/dir',\n});\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/BaseAnalysis.ts#L95"},"heap-analysis/src/BaseAnalysis.ts:95"))))),(0,s.yg)("hr",null),(0,s.yg)("h3",{id:"getcommandname"},(0,s.yg)("a",{id:"getcommandname"}),(0,s.yg)("strong",{parentName:"h3"},"getCommandName"),"()"),(0,s.yg)("p",null,"Get the name of the heap analysis, which is also used to reference\nthe analysis in memlab command-line tool."),(0,s.yg)("p",null,"The following terminal command will initiate with this analysis:\n",(0,s.yg)("inlineCode",{parentName:"p"},"memlab analyze ")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Returns"),": ",(0,s.yg)("inlineCode",{parentName:"li"},"string")," | the name of the analysis"),(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Examples"),":")),(0,s.yg)("pre",null,(0,s.yg)("code",{parentName:"pre",className:"language-typescript"},"const analysis = new YourAnalysis();\nconst name = analysis.getCommandName();\n")),(0,s.yg)("ul",null,(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("strong",{parentName:"li"},"Source"),":",(0,s.yg)("ul",{parentName:"li"},(0,s.yg)("li",{parentName:"ul"},(0,s.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/heap-analysis/src/plugins/ObjectFanoutAnalysis.ts#L22"},"heap-analysis/src/plugins/ObjectFanoutAnalysis.ts:22"))))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/fc5c0a35.76020411.js b/assets/js/fc5c0a35.9385b9e4.js similarity index 97% rename from assets/js/fc5c0a35.76020411.js rename to assets/js/fc5c0a35.9385b9e4.js index 2ebcb8c14..74485356f 100644 --- a/assets/js/fc5c0a35.76020411.js +++ b/assets/js/fc5c0a35.9385b9e4.js @@ -1 +1 @@ -"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9539],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>d});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=t.createContext({}),p=function(e){var a=t.useContext(c),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},s=function(e){var a=p(e.components);return t.createElement(c.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},y=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,l=e.originalType,c=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),g=p(n),y=r,d=g["".concat(c,".").concat(y)]||g[y]||m[y]||l;return n?t.createElement(d,i(i({ref:a},s),{},{components:n})):t.createElement(d,i({ref:a},s))}));function d(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=y;var o={};for(var c in a)hasOwnProperty.call(a,c)&&(o[c]=a[c]);o.originalType=e,o[g]="string"==typeof e?e:r,i[1]=o;for(var p=2;p{n.r(a),n.d(a,{assets:()=>c,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var t=n(8168),r=(n(6540),n(5680));const l={id:"core_src.IScenario",title:"Interface: IScenario",sidebar_label:"IScenario",custom_edit_url:null},i=void 0,o={unversionedId:"api/interfaces/core_src.IScenario",id:"api/interfaces/core_src.IScenario",title:"Interface: IScenario",description:"Test scenario specifies how you want a E2E test to interact with a web browser.",source:"@site/docs/api/interfaces/core_src.IScenario.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IScenario",permalink:"/memlab/docs/api/interfaces/core_src.IScenario",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IScenario",title:"Interface: IScenario",sidebar_label:"IScenario",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ILeakFilter",permalink:"/memlab/docs/api/interfaces/core_src.ILeakFilter"}},c={},p=[{value:"Properties",id:"properties",level:2},{value:' Optional action: InteractionsCallback',id:"-optional-action-interactionscallback",level:3},{value:' Optional back: InteractionsCallback',id:"-optional-back-interactionscallback",level:3},{value:' Optional beforeInitialPageLoad: InteractionsCallback',id:"-optional-beforeinitialpageload-interactionscallback",level:3},{value:' Optional beforeLeakFilter: InitLeakFilterCallback',id:"-optional-beforeleakfilter-initleakfiltercallback",level:3},{value:' Optional isPageLoaded: CheckPageLoadCallback',id:"-optional-ispageloaded-checkpageloadcallback",level:3},{value:' Optional leakFilter: LeakFilterCallback',id:"-optional-leakfilter-leakfiltercallback",level:3},{value:' Optional retainerReferenceFilter: ReferenceFilterCallback',id:"-optional-retainerreferencefilter-referencefiltercallback",level:3},{value:' Optional setup: InteractionsCallback',id:"-optional-setup-interactionscallback",level:3},{value:"Methods",id:"methods",level:2},{value:'Optional cookies()',id:"optional-cookies",level:3},{value:'Optional repeat()',id:"optional-repeat",level:3},{value:'url()',id:"url",level:3}],s={toc:p},g="wrapper";function m(e){let{components:a,...n}=e;return(0,r.yg)(g,(0,t.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"Test scenario specifies how you want a E2E test to interact with a web browser.\nThe test scenario can be saved as a ",(0,r.yg)("inlineCode",{parentName:"p"},".js")," file and passed to the ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab\nrun --scenario")," command:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as test.js and use in terminal:\n// $ memlab run --scenario test.js\n\nmodule.exports = {\n url: () => 'https://www.npmjs.com/',\n action: async () => ... ,\n back: async () => ... ,\n cookies: () => ... , // optional\n repeat: () => ... , // optional\n ...\n};\n")),(0,r.yg)("p",null,"The test scenario instance can also be passed to the\n",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#run"},"run")," API exported by ",(0,r.yg)("inlineCode",{parentName:"p"},"@memlab/api"),"."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const {run} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n action: async () => ... ,\n back: async () => ... ,\n cookies: () => ... , // optional\n repeat: () => ... , // optional\n ...\n };\n const leaks = await run({scenario});\n})();\n")),(0,r.yg)("h2",{id:"properties"},"Properties"),(0,r.yg)("h3",{id:"-optional-action-interactionscallback"},(0,r.yg)("a",{id:"action",name:"action"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"action"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"action")," is the callback function that defines the interaction\nwhere you want to trigger memory leaks after the initial page load.\nAll JS objects in browser allocated by the browser interactions triggered\nfrom the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback will be candidates for memory leak filtering."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("p",null,"Note: always clean up external puppeteer references to JS objects\nin the browser context."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n action: async (page) => {\n const elements = await page.$x(\"//button[contains(., 'Text in Button')]\");\n const [button] = elements;\n if (button) {\n await button.click();\n }\n // dispose external references to JS objects in browser context\n await promise.all(elements.map(e => e.dispose()));\n },\n back: async (page) => ... ,\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L841"},"core/src/lib/Types.ts:841"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-back-interactionscallback"},(0,r.yg)("a",{id:"back",name:"back"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"back"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"back")," is the callback function that specifies how memlab should\nback/revert the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback. Think of it as an undo action."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n")),(0,r.yg)("p",null,"Check out ",(0,r.yg)("a",{parentName:"p",href:"/docs/how-memlab-works"},"this page")," on why\nmemlab needs to undo/revert the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L867"},"core/src/lib/Types.ts:867"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-beforeinitialpageload-interactionscallback"},(0,r.yg)("a",{id:"beforeinitialpageload",name:"beforeinitialpageload"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"beforeInitialPageLoad"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"beforeInitialPageLoad")," is the callback function that will be called only\nonce before the initial page load. This callback can be used to set up\nthe HTTP headers or to prepare data before loading the web page."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n beforeInitialPageLoad: async (page) => {\n // before the initial page load\n },\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L745"},"core/src/lib/Types.ts:745"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-beforeleakfilter-initleakfiltercallback"},(0,r.yg)("a",{id:"beforeleakfilter",name:"beforeleakfilter"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"beforeLeakFilter"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#initleakfiltercallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InitLeakFilterCallback"))),(0,r.yg)("p",null,"Lifecycle function callback that is invoked initially once before\nthe subsequent ",(0,r.yg)("inlineCode",{parentName:"p"},"leakFilter")," function calls. This callback could\nbe used to initialize some data stores or to any one-off\npreprocessings."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,r.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,r.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n beforeLeakFilter: (snapshot, leakedNodeIds) {\n // initialize some data stores\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L953"},"core/src/lib/Types.ts:953"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-ispageloaded-checkpageloadcallback"},(0,r.yg)("a",{id:"ispageloaded",name:"ispageloaded"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"isPageLoaded"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#checkpageloadcallback"},(0,r.yg)("inlineCode",{parentName:"a"},"CheckPageLoadCallback"))),(0,r.yg)("p",null,"Optional callback function that checks if the web page is loaded\nfor the initial page load and subsequent browser interactions."),(0,r.yg)("p",null,"If this callback is not provided, memlab by default\nconsiders a navigation to be finished when there are no network\nconnections for at least 500ms."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": a boolean value, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),", memlab will consider\nthe navigation completes, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"false"),", memlab will keep calling\nthis callback until it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),". This is an async callback, you can\nalso ",(0,r.yg)("inlineCode",{parentName:"p"},"await")," and returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," until some async logic is resolved.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n isPageLoaded: async (page) => {\n await page.waitForNavigation({\n // consider navigation to be finished when there are\n // no more than 2 network connections for at least 500 ms.\n waitUntil: 'networkidle2',\n // Maximum navigation time in milliseconds\n timeout: 5000,\n });\n return true;\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L925"},"core/src/lib/Types.ts:925"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-leakfilter-leakfiltercallback"},(0,r.yg)("a",{id:"leakfilter",name:"leakfilter"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"leakFilter"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#leakfiltercallback"},(0,r.yg)("inlineCode",{parentName:"a"},"LeakFilterCallback"))),(0,r.yg)("p",null,"This callback defines how you want to filter out the\nleaked objects. The callback is called for every node (JS heap\nobject in browser) allocated by the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback, but not\nreleased after the ",(0,r.yg)("inlineCode",{parentName:"p"},"back")," callback. Those objects could be caches\nthat are retained in memory on purpose, or they are memory leaks."),(0,r.yg)("p",null,"This optional callback allows you to define your own algorithm\nto cherry pick memory leaks for specific JS program under test."),(0,r.yg)("p",null,"If this optional callback is not defined, memlab will use its\nbuilt-in leak filter, which considers detached DOM elements\nand unmounted Fiber nodes (detached from React Fiber tree) as\nmemory leaks."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode"))," | the heap object\nallocated but not released. This filter callback will be applied\nto each node allocated but not released in the heap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,r.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,r.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": the boolean value indicating whether the given node in\nthe snapshot should be considered as leaked.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n leakFilter(node, snapshot, leakedNodeIds) {\n // any unreleased node (JS heap object) with 1MB+\n // retained size is considered a memory leak\n return node.retainedSize > 1000000;\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L998"},"core/src/lib/Types.ts:998"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-retainerreferencefilter-referencefiltercallback"},(0,r.yg)("a",{id:"retainerreferencefilter",name:"retainerreferencefilter"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"retainerReferenceFilter"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#referencefiltercallback"},(0,r.yg)("inlineCode",{parentName:"a"},"ReferenceFilterCallback"))),(0,r.yg)("p",null,"Callback that can be used to define a logic to decide whether\na reference should be considered as part of the retainer trace.\nThe callback is called for every reference (edge) in the heap snapshot."),(0,r.yg)("p",null,"For concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#leakfilter"},"leakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"edge")," : ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge"))," | the reference (edge)\nthat is considered for calcualting the retainer trace"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the heap snapshot\ntaken after all browser interactions are done.\nCheck out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"isReferenceUsedByDefault"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | MemLab has its own default\nlogic for whether a reference should be considered as part of the\nretainer trace, if this parameter is true, it means MemLab will\nconsider this reference when calculating the retainer trace."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": the value indicating whether the given reference should be\nconsidered when calculating the retainer trace. Note that when this\ncallback returns true, the reference will only be considered as a candidate\nfor retainer trace, so it may or may not be included in the retainer trace;\nhowever, if this callback returns false, the reference will be excluded."))),(0,r.yg)("p",null,"Note that by excluding a dominator reference of an object (i.e., an edge\nthat must be traveled through to reach the heap object from GC roots),\nthe object will be considered as unreachable in the heap graph; and\ntherefore, the reference and heap object will not be included in the\nretainer trace detection and retainer size calculation."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as leak-filter.js\nmodule.exports = {\n retainerReferenceFilter(edge, _snapshot, _leakedNodeIds) {\n // exclude react fiber references\n if (edge.name_or_index.toString().startsWith('__reactFiber$')) {\n return false;\n }\n return true;\n }\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L1044"},"core/src/lib/Types.ts:1044"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-setup-interactionscallback"},(0,r.yg)("a",{id:"setup",name:"setup"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"setup"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"setup")," is the callback function that will be called only once\nafter the initial page load. This callback can be used to log in\nif you have to (we recommend using ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#cookies"},"cookies"),")\nor to prepare data before the ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#action"},"action")," call."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n setup: async (page) => {\n // log in or prepare data for the interaction\n },\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L794"},"core/src/lib/Types.ts:794"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"optional-cookies"},(0,r.yg)("a",{id:"cookies"}),(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"cookies"),"()"),(0,r.yg)("p",null,"If the page you are running memlab against requires authentication or\nspecific cookie(s) to be set, you can pass them as\na list of ",(0,r.yg)("inlineCode",{parentName:"p"},"")," tuples."),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Note"),": please make sure that you provide the correct ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field for\nthe cookies tuples. If no ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field is specified, memlab will try\nto fill in a domain based on the ",(0,r.yg)("inlineCode",{parentName:"p"},"url")," callback.\nFor example, when the ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field is absent,\nmemlab will auto fill in ",(0,r.yg)("inlineCode",{parentName:"p"},".facebook.com")," as domain base\non the initial page load's url: ",(0,r.yg)("inlineCode",{parentName:"p"},"https://www.facebook.com/"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#cookies"},(0,r.yg)("inlineCode",{parentName:"a"},"Cookies"))," | cookie list"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.facebook.com/',\n cookies: () => [\n {name:'cm_j', value: 'none', domain: '.facebook.com'},\n {name:'datr', value: 'yJvIY...', domain: '.facebook.com'},\n {name:'c_user', value: '8917...', domain: '.facebook.com'},\n {name:'xs', value: '95:9WQ...', domain: '.facebook.com'},\n // ...\n ],\n};\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L715"},"core/src/lib/Types.ts:715"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"optional-repeat"},(0,r.yg)("a",{id:"repeat"}),(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"repeat"),"()"),(0,r.yg)("p",null,"Specifies how many ",(0,r.yg)("strong",{parentName:"p"},"extra")," ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"back")," actions performed\nby memlab."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": a number value specifies the number of extra actions.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n // browser interaction: two additional [ action -> back ]\n // init-load -> action -> back -> action -> back -> action -> back\n repeat: () => 2,\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"number")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L886"},"core/src/lib/Types.ts:886"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"url"},(0,r.yg)("a",{id:"url"}),(0,r.yg)("strong",{parentName:"h3"},"url"),"()"),(0,r.yg)("p",null,"String value of the initial url of the page."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the string value of the initial url"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n};\n\nmodule.exports = scenario;\n")),(0,r.yg)("p",null,"If a test scenario only specifies the ",(0,r.yg)("inlineCode",{parentName:"p"},"url")," callback (without the ",(0,r.yg)("inlineCode",{parentName:"p"},"action"),"\ncallback), memlab will try to detect memory leaks from the initial page\nload. All objects allocated by the initial page load will be candidates\nfor memory leak filtering."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/b52e7dc/packages/core/src/lib/Types.ts#L763"},"core/src/lib/Types.ts:763"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[9539],{5680:(e,a,n)=>{n.d(a,{xA:()=>s,yg:()=>d});var t=n(6540);function r(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function l(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var a=1;a=0||(r[n]=e[n]);return r}(e,a);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=t.createContext({}),p=function(e){var a=t.useContext(c),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},s=function(e){var a=p(e.components);return t.createElement(c.Provider,{value:a},e.children)},g="mdxType",m={inlineCode:"code",wrapper:function(e){var a=e.children;return t.createElement(t.Fragment,{},a)}},y=t.forwardRef((function(e,a){var n=e.components,r=e.mdxType,l=e.originalType,c=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),g=p(n),y=r,d=g["".concat(c,".").concat(y)]||g[y]||m[y]||l;return n?t.createElement(d,i(i({ref:a},s),{},{components:n})):t.createElement(d,i({ref:a},s))}));function d(e,a){var n=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var l=n.length,i=new Array(l);i[0]=y;var o={};for(var c in a)hasOwnProperty.call(a,c)&&(o[c]=a[c]);o.originalType=e,o[g]="string"==typeof e?e:r,i[1]=o;for(var p=2;p{n.r(a),n.d(a,{assets:()=>c,contentTitle:()=>i,default:()=>m,frontMatter:()=>l,metadata:()=>o,toc:()=>p});var t=n(8168),r=(n(6540),n(5680));const l={id:"core_src.IScenario",title:"Interface: IScenario",sidebar_label:"IScenario",custom_edit_url:null},i=void 0,o={unversionedId:"api/interfaces/core_src.IScenario",id:"api/interfaces/core_src.IScenario",title:"Interface: IScenario",description:"Test scenario specifies how you want a E2E test to interact with a web browser.",source:"@site/docs/api/interfaces/core_src.IScenario.md",sourceDirName:"api/interfaces",slug:"/api/interfaces/core_src.IScenario",permalink:"/memlab/docs/api/interfaces/core_src.IScenario",draft:!1,editUrl:null,tags:[],version:"current",frontMatter:{id:"core_src.IScenario",title:"Interface: IScenario",sidebar_label:"IScenario",custom_edit_url:null},sidebar:"sidebar",previous:{title:"ILeakFilter",permalink:"/memlab/docs/api/interfaces/core_src.ILeakFilter"}},c={},p=[{value:"Properties",id:"properties",level:2},{value:' Optional action: InteractionsCallback',id:"-optional-action-interactionscallback",level:3},{value:' Optional back: InteractionsCallback',id:"-optional-back-interactionscallback",level:3},{value:' Optional beforeInitialPageLoad: InteractionsCallback',id:"-optional-beforeinitialpageload-interactionscallback",level:3},{value:' Optional beforeLeakFilter: InitLeakFilterCallback',id:"-optional-beforeleakfilter-initleakfiltercallback",level:3},{value:' Optional isPageLoaded: CheckPageLoadCallback',id:"-optional-ispageloaded-checkpageloadcallback",level:3},{value:' Optional leakFilter: LeakFilterCallback',id:"-optional-leakfilter-leakfiltercallback",level:3},{value:' Optional retainerReferenceFilter: ReferenceFilterCallback',id:"-optional-retainerreferencefilter-referencefiltercallback",level:3},{value:' Optional setup: InteractionsCallback',id:"-optional-setup-interactionscallback",level:3},{value:"Methods",id:"methods",level:2},{value:'Optional cookies()',id:"optional-cookies",level:3},{value:'Optional repeat()',id:"optional-repeat",level:3},{value:'url()',id:"url",level:3}],s={toc:p},g="wrapper";function m(e){let{components:a,...n}=e;return(0,r.yg)(g,(0,t.A)({},s,n,{components:a,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"Test scenario specifies how you want a E2E test to interact with a web browser.\nThe test scenario can be saved as a ",(0,r.yg)("inlineCode",{parentName:"p"},".js")," file and passed to the ",(0,r.yg)("inlineCode",{parentName:"p"},"memlab\nrun --scenario")," command:"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as test.js and use in terminal:\n// $ memlab run --scenario test.js\n\nmodule.exports = {\n url: () => 'https://www.npmjs.com/',\n action: async () => ... ,\n back: async () => ... ,\n cookies: () => ... , // optional\n repeat: () => ... , // optional\n ...\n};\n")),(0,r.yg)("p",null,"The test scenario instance can also be passed to the\n",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/modules/api_src#run"},"run")," API exported by ",(0,r.yg)("inlineCode",{parentName:"p"},"@memlab/api"),"."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const {run} = require('@memlab/api');\n\n(async function () {\n const scenario = {\n url: () => 'https://www.facebook.com',\n action: async () => ... ,\n back: async () => ... ,\n cookies: () => ... , // optional\n repeat: () => ... , // optional\n ...\n };\n const leaks = await run({scenario});\n})();\n")),(0,r.yg)("h2",{id:"properties"},"Properties"),(0,r.yg)("h3",{id:"-optional-action-interactionscallback"},(0,r.yg)("a",{id:"action",name:"action"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"action"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"action")," is the callback function that defines the interaction\nwhere you want to trigger memory leaks after the initial page load.\nAll JS objects in browser allocated by the browser interactions triggered\nfrom the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback will be candidates for memory leak filtering."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("p",null,"Note: always clean up external puppeteer references to JS objects\nin the browser context."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n action: async (page) => {\n const elements = await page.$x(\"//button[contains(., 'Text in Button')]\");\n const [button] = elements;\n if (button) {\n await button.click();\n }\n // dispose external references to JS objects in browser context\n await promise.all(elements.map(e => e.dispose()));\n },\n back: async (page) => ... ,\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L841"},"core/src/lib/Types.ts:841"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-back-interactionscallback"},(0,r.yg)("a",{id:"back",name:"back"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"back"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"back")," is the callback function that specifies how memlab should\nback/revert the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback. Think of it as an undo action."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n")),(0,r.yg)("p",null,"Check out ",(0,r.yg)("a",{parentName:"p",href:"/docs/how-memlab-works"},"this page")," on why\nmemlab needs to undo/revert the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L867"},"core/src/lib/Types.ts:867"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-beforeinitialpageload-interactionscallback"},(0,r.yg)("a",{id:"beforeinitialpageload",name:"beforeinitialpageload"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"beforeInitialPageLoad"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"beforeInitialPageLoad")," is the callback function that will be called only\nonce before the initial page load. This callback can be used to set up\nthe HTTP headers or to prepare data before loading the web page."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n beforeInitialPageLoad: async (page) => {\n // before the initial page load\n },\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L745"},"core/src/lib/Types.ts:745"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-beforeleakfilter-initleakfiltercallback"},(0,r.yg)("a",{id:"beforeleakfilter",name:"beforeleakfilter"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"beforeLeakFilter"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#initleakfiltercallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InitLeakFilterCallback"))),(0,r.yg)("p",null,"Lifecycle function callback that is invoked initially once before\nthe subsequent ",(0,r.yg)("inlineCode",{parentName:"p"},"leakFilter")," function calls. This callback could\nbe used to initialize some data stores or to any one-off\npreprocessings."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,r.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,r.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n beforeLeakFilter: (snapshot, leakedNodeIds) {\n // initialize some data stores\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L953"},"core/src/lib/Types.ts:953"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-ispageloaded-checkpageloadcallback"},(0,r.yg)("a",{id:"ispageloaded",name:"ispageloaded"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"isPageLoaded"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#checkpageloadcallback"},(0,r.yg)("inlineCode",{parentName:"a"},"CheckPageLoadCallback"))),(0,r.yg)("p",null,"Optional callback function that checks if the web page is loaded\nfor the initial page load and subsequent browser interactions."),(0,r.yg)("p",null,"If this callback is not provided, memlab by default\nconsiders a navigation to be finished when there are no network\nconnections for at least 500ms."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": a boolean value, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),", memlab will consider\nthe navigation completes, if it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"false"),", memlab will keep calling\nthis callback until it returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true"),". This is an async callback, you can\nalso ",(0,r.yg)("inlineCode",{parentName:"p"},"await")," and returns ",(0,r.yg)("inlineCode",{parentName:"p"},"true")," until some async logic is resolved.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n isPageLoaded: async (page) => {\n await page.waitForNavigation({\n // consider navigation to be finished when there are\n // no more than 2 network connections for at least 500 ms.\n waitUntil: 'networkidle2',\n // Maximum navigation time in milliseconds\n timeout: 5000,\n });\n return true;\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L925"},"core/src/lib/Types.ts:925"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-leakfilter-leakfiltercallback"},(0,r.yg)("a",{id:"leakfilter",name:"leakfilter"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"leakFilter"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#leakfiltercallback"},(0,r.yg)("inlineCode",{parentName:"a"},"LeakFilterCallback"))),(0,r.yg)("p",null,"This callback defines how you want to filter out the\nleaked objects. The callback is called for every node (JS heap\nobject in browser) allocated by the ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," callback, but not\nreleased after the ",(0,r.yg)("inlineCode",{parentName:"p"},"back")," callback. Those objects could be caches\nthat are retained in memory on purpose, or they are memory leaks."),(0,r.yg)("p",null,"This optional callback allows you to define your own algorithm\nto cherry pick memory leaks for specific JS program under test."),(0,r.yg)("p",null,"If this optional callback is not defined, memlab will use its\nbuilt-in leak filter, which considers detached DOM elements\nand unmounted Fiber nodes (detached from React Fiber tree) as\nmemory leaks."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"node"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapNode"},"IHeapNode"))," | the heap object\nallocated but not released. This filter callback will be applied\nto each node allocated but not released in the heap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the final heap\nsnapshot taken after all browser interactions are done.\nCheck out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"leakedNodeIds"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"Set")," | the set of ids of all JS heap objects\nallocated by the ",(0,r.yg)("inlineCode",{parentName:"li"},"action")," call but not released after the ",(0,r.yg)("inlineCode",{parentName:"li"},"back")," call\nin browser."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": the boolean value indicating whether the given node in\nthe snapshot should be considered as leaked.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n leakFilter(node, snapshot, leakedNodeIds) {\n // any unreleased node (JS heap object) with 1MB+\n // retained size is considered a memory leak\n return node.retainedSize > 1000000;\n },\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L998"},"core/src/lib/Types.ts:998"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-retainerreferencefilter-referencefiltercallback"},(0,r.yg)("a",{id:"retainerreferencefilter",name:"retainerreferencefilter"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"retainerReferenceFilter"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#referencefiltercallback"},(0,r.yg)("inlineCode",{parentName:"a"},"ReferenceFilterCallback"))),(0,r.yg)("p",null,"Callback that can be used to define a logic to decide whether\na reference should be considered as part of the retainer trace.\nThe callback is called for every reference (edge) in the heap snapshot."),(0,r.yg)("p",null,"For concrete examples, check out ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#leakfilter"},"leakFilter"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"edge")," : ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapEdge"},"IHeapEdge"))," | the reference (edge)\nthat is considered for calcualting the retainer trace"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"snapshot"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot"))," | the heap snapshot\ntaken after all browser interactions are done.\nCheck out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot"},"IHeapSnapshot")," for more APIs that queries the\nheap snapshot."),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"isReferenceUsedByDefault"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"boolean")," | MemLab has its own default\nlogic for whether a reference should be considered as part of the\nretainer trace, if this parameter is true, it means MemLab will\nconsider this reference when calculating the retainer trace."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": the value indicating whether the given reference should be\nconsidered when calculating the retainer trace. Note that when this\ncallback returns true, the reference will only be considered as a candidate\nfor retainer trace, so it may or may not be included in the retainer trace;\nhowever, if this callback returns false, the reference will be excluded."))),(0,r.yg)("p",null,"Note that by excluding a dominator reference of an object (i.e., an edge\nthat must be traveled through to reach the heap object from GC roots),\nthe object will be considered as unreachable in the heap graph; and\ntherefore, the reference and heap object will not be included in the\nretainer trace detection and retainer size calculation."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-javascript"},"// save as leak-filter.js\nmodule.exports = {\n retainerReferenceFilter(edge, _snapshot, _leakedNodeIds) {\n // exclude react fiber references\n if (edge.name_or_index.toString().startsWith('__reactFiber$')) {\n return false;\n }\n return true;\n }\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L1044"},"core/src/lib/Types.ts:1044"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"-optional-setup-interactionscallback"},(0,r.yg)("a",{id:"setup",name:"setup"})," ",(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"setup"),": ",(0,r.yg)("a",{parentName:"h3",href:"/memlab/docs/api/modules/core_src#interactionscallback"},(0,r.yg)("inlineCode",{parentName:"a"},"InteractionsCallback"))),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"setup")," is the callback function that will be called only once\nafter the initial page load. This callback can be used to log in\nif you have to (we recommend using ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#cookies"},"cookies"),")\nor to prepare data before the ",(0,r.yg)("a",{parentName:"p",href:"/memlab/docs/api/interfaces/core_src.IScenario#action"},"action")," call."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Parameters"),":"),(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("inlineCode",{parentName:"li"},"page"),": ",(0,r.yg)("code",null,(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"))," | the puppeteer\n",(0,r.yg)("a",{parentName:"li",href:"https://pptr.dev/api/puppeteer.page"},(0,r.yg)("inlineCode",{parentName:"a"},"Page")),"\nobject, which provides APIs to interact with the web browser. To import\nthis type, check out ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#page"},"Page"),"."))),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n setup: async (page) => {\n // log in or prepare data for the interaction\n },\n action: async (page) => {\n await page.click('a[href=\"/link\"]');\n },\n back: async (page) => {\n await page.click('a[href=\"/back\"]');\n },\n}\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L794"},"core/src/lib/Types.ts:794"))))),(0,r.yg)("h2",{id:"methods"},"Methods"),(0,r.yg)("h3",{id:"optional-cookies"},(0,r.yg)("a",{id:"cookies"}),(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"cookies"),"()"),(0,r.yg)("p",null,"If the page you are running memlab against requires authentication or\nspecific cookie(s) to be set, you can pass them as\na list of ",(0,r.yg)("inlineCode",{parentName:"p"},"")," tuples."),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Note"),": please make sure that you provide the correct ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field for\nthe cookies tuples. If no ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field is specified, memlab will try\nto fill in a domain based on the ",(0,r.yg)("inlineCode",{parentName:"p"},"url")," callback.\nFor example, when the ",(0,r.yg)("inlineCode",{parentName:"p"},"domain")," field is absent,\nmemlab will auto fill in ",(0,r.yg)("inlineCode",{parentName:"p"},".facebook.com")," as domain base\non the initial page load's url: ",(0,r.yg)("inlineCode",{parentName:"p"},"https://www.facebook.com/"),"."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("a",{parentName:"li",href:"/memlab/docs/api/modules/core_src#cookies"},(0,r.yg)("inlineCode",{parentName:"a"},"Cookies"))," | cookie list"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.facebook.com/',\n cookies: () => [\n {name:'cm_j', value: 'none', domain: '.facebook.com'},\n {name:'datr', value: 'yJvIY...', domain: '.facebook.com'},\n {name:'c_user', value: '8917...', domain: '.facebook.com'},\n {name:'xs', value: '95:9WQ...', domain: '.facebook.com'},\n // ...\n ],\n};\n\nmodule.exports = scenario;\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L715"},"core/src/lib/Types.ts:715"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"optional-repeat"},(0,r.yg)("a",{id:"repeat"}),(0,r.yg)("inlineCode",{parentName:"h3"},"Optional")," ",(0,r.yg)("strong",{parentName:"h3"},"repeat"),"()"),(0,r.yg)("p",null,"Specifies how many ",(0,r.yg)("strong",{parentName:"p"},"extra")," ",(0,r.yg)("inlineCode",{parentName:"p"},"action")," and ",(0,r.yg)("inlineCode",{parentName:"p"},"back")," actions performed\nby memlab."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Returns"),": a number value specifies the number of extra actions.")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("p",{parentName:"li"},(0,r.yg)("strong",{parentName:"p"},"Examples"),":"))),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"module.exports = {\n url: () => ... ,\n action: async (page) => ... ,\n back: async (page) => ... ,\n // browser interaction: two additional [ action -> back ]\n // init-load -> action -> back -> action -> back -> action -> back\n repeat: () => 2,\n};\n")),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"number")),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L886"},"core/src/lib/Types.ts:886"))))),(0,r.yg)("hr",null),(0,r.yg)("h3",{id:"url"},(0,r.yg)("a",{id:"url"}),(0,r.yg)("strong",{parentName:"h3"},"url"),"()"),(0,r.yg)("p",null,"String value of the initial url of the page."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Returns"),": ",(0,r.yg)("inlineCode",{parentName:"li"},"string")," | the string value of the initial url"),(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Examples"),":")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-typescript"},"const scenario = {\n url: () => 'https://www.npmjs.com/',\n};\n\nmodule.exports = scenario;\n")),(0,r.yg)("p",null,"If a test scenario only specifies the ",(0,r.yg)("inlineCode",{parentName:"p"},"url")," callback (without the ",(0,r.yg)("inlineCode",{parentName:"p"},"action"),"\ncallback), memlab will try to detect memory leaks from the initial page\nload. All objects allocated by the initial page load will be candidates\nfor memory leak filtering."),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("strong",{parentName:"li"},"Source"),":",(0,r.yg)("ul",{parentName:"li"},(0,r.yg)("li",{parentName:"ul"},(0,r.yg)("a",{parentName:"li",href:"https://github.com/facebook/memlab/blob/37bef92/packages/core/src/lib/Types.ts#L763"},"core/src/lib/Types.ts:763"))))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/main.0664c0d2.js b/assets/js/main.0664c0d2.js new file mode 100644 index 000000000..55f0535b0 --- /dev/null +++ b/assets/js/main.0664c0d2.js @@ -0,0 +1,2 @@ +/*! For license information please see main.0664c0d2.js.LICENSE.txt */ +(self.webpackChunkmemlab_website=self.webpackChunkmemlab_website||[]).push([[8792],{3219:(e,t,n)=>{"use strict";n.d(t,{Bc:()=>C,E8:()=>Xn,a1:()=>Yn});var r=n(6540);n(961);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0;--o){var i=this.tryEntries[o],l=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;P(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function w(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],s=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return l}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function k(e){var t="function"==typeof Map?new Map:void 0;return k=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(m())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&y(a,n.prototype),a}(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)},k(e)}function _(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}function O(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20","aria-hidden":"true"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}var x=["translations"],A="Ctrl",C=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=b(e,x),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,c=void 0===s?"Search":s,u=w((0,r.useState)(null),2),f=u[0],p=u[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("\u2318"):p(A))}),[]),r.createElement("button",d({type:"button",className:"DocSearch DocSearch-Button","aria-label":c},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(O,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==f&&r.createElement(r.Fragment,null,r.createElement(T,{reactsToKey:f===A?A:"Meta"},f===A?r.createElement(_,null):f),r.createElement(T,{reactsToKey:"k"},"K"))))}));function T(e){var t=e.reactsToKey,n=e.children,a=w((0,r.useState)(!1),2),o=a[0],i=a[1];return(0,r.useEffect)((function(){if(t)return window.addEventListener("keydown",e),window.addEventListener("keyup",n),function(){window.removeEventListener("keydown",e),window.removeEventListener("keyup",n)};function e(e){e.key===t&&i(!0)}function n(e){e.key!==t&&"Meta"!==e.key||i(!1)}}),[t]),r.createElement("kbd",{className:o?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"},n)}function P(e,t){var n=void 0;return function(){for(var r=arguments.length,a=new Array(r),o=0;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function W(e){for(var t=1;t=3||2===n&&r>=4||1===n&&r>=10);function o(t,n,r){if(a&&void 0!==r){var o=r[0].__autocomplete_algoliaCredentials,i={"X-Algolia-Application-Id":o.appId,"X-Algolia-API-Key":o.apiKey};e.apply(void 0,[t].concat(H(n),[{headers:i}]))}else e.apply(void 0,[t].concat(H(n)))}return{init:function(t,n){e("init",{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e("setAuthenticatedUserToken",t)},setUserToken:function(t){e("setUserToken",t)},clickedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&o("clickedObjectIDsAfterSearch",Q(t),t[0].items)},clickedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&o("clickedObjectIDs",Q(t),t[0].items)},clickedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&e.apply(void 0,["clickedFilters"].concat(n))},convertedObjectIDsAfterSearch:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&o("convertedObjectIDsAfterSearch",Q(t),t[0].items)},convertedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&o("convertedObjectIDs",Q(t),t[0].items)},convertedFilters:function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&e.apply(void 0,["convertedFilters"].concat(n))},viewedObjectIDs:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&t.reduce((function(e,t){var n=t.items,r=G(t,z);return[].concat(H(e),H(function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=[],r=0;r0&&e.apply(void 0,["viewedFilters"].concat(n))}}}function X(e){var t=e.items.reduce((function(e,t){var n;return e[t.__autocomplete_indexName]=(null!==(n=e[t.__autocomplete_indexName])&&void 0!==n?n:[]).concat(t),e}),{});return Object.keys(t).map((function(e){return{index:e,items:t[e],algoliaSource:["autocomplete"]}}))}function J(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}function ee(e){return function(e){if(Array.isArray(e))return te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&le({onItemsChange:a,items:n,insights:c,state:t}))}}),0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive,a=!1;function u(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:re(re({},l?{clickAnalytics:!0}:{}),e?{userToken:ue(e)}:{}),insights:c}})}s("addAlgoliaAgent","insights-plugin"),u(),s("onUserTokenChange",(function(e){a||u(e)})),s("getUserToken",null,(function(e,t){a||u(t)})),s("onAuthenticatedUserTokenChange",(function(e){e?(a=!0,u(e)):(a=!1,s("getUserToken",null,(function(e,t){return u(t)})))})),s("getAuthenticatedUserToken",null,(function(e,t){t&&(a=!0,u(t))})),n((function(e){var t=e.item,n=e.state,r=e.event,a=e.source;J(t)&&o({state:n,event:r,insights:c,item:t,insightsEvents:[re({eventName:"Item Selected"},F({item:t,items:a.getItems().filter(J)}))]})})),r((function(e){var t=e.item,n=e.source,r=e.state,a=e.event;J(t)&&i({state:r,event:a,insights:c,item:t,insightsEvents:[re({eventName:"Item Active"},F({item:t,items:n.getItems().filter(J)}))]})}))},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function ce(){var e,t=arguments.length>1?arguments[1]:void 0;return[].concat(ee(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]),["autocomplete-internal"],ee(null!==(e=t.algoliaInsightsPlugin)&&void 0!==e&&e.__automaticInsights?["autocomplete-automatic"]:[]))}function ue(e){return"number"==typeof e?e.toString():e}function de(e,t){var n=t;return{then:function(t,r){return de(e.then(pe(t,n,e),pe(r,n,e)),n)},catch:function(t){return de(e.catch(pe(t,n,e)),n)},finally:function(t){return t&&n.onCancelList.push(t),de(e.finally(pe(t&&function(){return n.onCancelList=[],t()},n,e)),n)},cancel:function(){n.isCanceled=!0;var e=n.onCancelList;n.onCancelList=[],e.forEach((function(e){e()}))},isCanceled:function(){return!0===n.isCanceled}}}function fe(e){return de(e,{isCanceled:!1,onCancelList:[]})}function pe(e,t,n){return e?function(n){return t.isCanceled?n:e(n)}:n}function me(e,t,n,r){if(!n)return null;if(e<0&&(null===t||null!==r&&0===t))return n+e;var a=(null===t?-1:t)+e;return a<=-1||a>=n?null===r?null:0:a}function he(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ge(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0},reshape:function(e){return e.sources}},e),{},{id:null!==(n=e.id)&&void 0!==n?n:"autocomplete-".concat(L++),plugins:a,initialState:De({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var n;null===(n=e.onStateChange)||void 0===n||n.call(e,t),a.forEach((function(e){var n;return null===(n=e.onStateChange)||void 0===n?void 0:n.call(e,t)}))},onSubmit:function(t){var n;null===(n=e.onSubmit)||void 0===n||n.call(e,t),a.forEach((function(e){var n;return null===(n=e.onSubmit)||void 0===n?void 0:n.call(e,t)}))},onReset:function(t){var n;null===(n=e.onReset)||void 0===n||n.call(e,t),a.forEach((function(e){var n;return null===(n=e.onReset)||void 0===n?void 0:n.call(e,t)}))},getSources:function(n){return Promise.all([].concat(function(e){return function(e){if(Array.isArray(e))return Ie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ie(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return function(e,t){var n=[];return Promise.resolve(e(t)).then((function(e){return Promise.all(e.filter((function(e){return Boolean(e)})).map((function(e){if(e.sourceId,n.includes(e.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(e.sourceId)," is not unique."));n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:j,onResolve:j};Object.keys(t).forEach((function(e){t[e].__default=!0}));var r=ge(ge({},t),e);return Promise.resolve(r)})))}))}(e,n)}))).then((function(e){return I(e)})).then((function(e){return e.map((function(e){return De(De({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,n)}))},onActive:function(n){e.onActive(n),t.forEach((function(e){var t;return null===(t=e.onActive)||void 0===t?void 0:t.call(e,n)}))},onResolve:function(n){e.onResolve(n),t.forEach((function(e){var t;return null===(t=e.onResolve)||void 0===t?void 0:t.call(e,n)}))}})}))}))},navigator:De({navigate:function(e){var t=e.itemUrl;r.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,n=r.open(t,"_blank","noopener");null==n||n.focus()},navigateNewWindow:function(e){var t=e.itemUrl;r.open(t,"_blank","noopener")}},e.navigator)})}function je(e){return je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(e)}function Me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fe(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Qe);nt&&a.environment.clearTimeout(nt);var c=s.setCollections,u=s.setIsOpen,d=s.setQuery,f=s.setActiveItemId,p=s.setStatus,m=s.setContext;if(d(o),f(a.defaultActiveItemId),!o&&!1===a.openOnFocus){var h,g=l.getState().collections.map((function(e){return Xe(Xe({},e),{},{items:[]})}));p("idle"),c(g),u(null!==(h=r.isOpen)&&void 0!==h?h:a.shouldPanelOpen({state:l.getState()}));var b=fe(rt(g).then((function(){return Promise.resolve()})));return l.pendingRequests.add(b)}p("loading"),nt=a.environment.setTimeout((function(){p("stalled")}),a.stallThreshold);var v=fe(rt(a.getSources(Xe({query:o,refresh:i,state:l.getState()},s)).then((function(e){return Promise.all(e.map((function(e){return Promise.resolve(e.getItems(Xe({query:o,refresh:i,state:l.getState()},s))).then((function(t){return function(e,t,n){if(a=e,Boolean(null==a?void 0:a.execute)){var r="algolia"===e.requesterId?Object.assign.apply(Object,[{}].concat($e(Object.keys(n.context).map((function(e){var t;return null===(t=n.context[e])||void 0===t?void 0:t.__algoliaSearchParameters}))))):{};return qe(qe({},e),{},{requests:e.queries.map((function(n){return{query:"algolia"===e.requesterId?qe(qe({},n),{},{params:qe(qe({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}}))})}var a;return{items:e,sourceId:t}}(t,e.sourceId,l.getState())}))}))).then(We).then((function(t){var n,r=t.some((function(e){return function(e){return!Array.isArray(e)&&Boolean(null==e?void 0:e._automaticInsights)}(e.items)}));return r&&m({algoliaInsightsPlugin:Xe(Xe({},(null===(n=l.getState().context)||void 0===n?void 0:n.algoliaInsightsPlugin)||{}),{},{__automaticInsights:r})}),function(e,t,n){return t.map((function(t){var r,a=e.filter((function(e){return e.sourceId===t.sourceId})),o=a.map((function(e){return e.items})),i=a[0].transformResponse,l=i?i({results:r=o,hits:r.map((function(e){return e.hits})).filter(Boolean),facetHits:r.map((function(e){var t;return null===(t=e.facetHits)||void 0===t?void 0:t.map((function(e){return{label:e.value,count:e.count,_highlightResult:{label:{value:e.highlighted}}}}))})).filter(Boolean)}):o;return t.onResolve({source:t,results:o,items:l,state:n.getState()}),l.every(Boolean),'The `getItems` function from source "'.concat(t.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),".\n\nDid you forget to return items?\n\nSee: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems"),{source:t,items:l}}))}(t,e,l)})).then((function(e){return function(e){var t=e.props,n=e.state,r=e.collections.reduce((function(e,t){return Fe(Fe({},e),{},Be({},t.source.sourceId,Fe(Fe({},t.source),{},{getItems:function(){return I(t.items)}})))}),{}),a=t.plugins.reduce((function(e,t){return t.reshape?t.reshape(e):e}),{sourcesBySourceId:r,state:n}).sourcesBySourceId;return I(t.reshape({sourcesBySourceId:a,sources:Object.values(a),state:n})).filter(Boolean).map((function(e){return{source:e,items:e.getItems()}}))}({collections:e,props:a,state:l.getState()})}))})))).then((function(e){var n;p("idle"),c(e);var d=a.shouldPanelOpen({state:l.getState()});u(null!==(n=r.isOpen)&&void 0!==n?n:a.openOnFocus&&!o&&d||d);var f=ye(l.getState());if(null!==l.getState().activeItemId&&f){var m=f.item,h=f.itemInputValue,g=f.itemUrl,b=f.source;b.onActive(Xe({event:t,item:m,itemInputValue:h,itemUrl:g,refresh:i,source:b,state:l.getState()},s))}})).finally((function(){p("idle"),nt&&a.environment.clearTimeout(nt)}));return l.pendingRequests.add(v)}function ot(e){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ot(e)}var it=["event","props","refresh","store"];function lt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function st(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function Et(e){var t=e.props,n=e.refresh,r=e.store,a=wt(e,dt);return{getEnvironmentProps:function(e){var n=e.inputElement,a=e.formElement,o=e.panelElement;function i(e){!r.getState().isOpen&&r.pendingRequests.isEmpty()||e.target===n||!1===[a,o].some((function(t){return(n=t)===(r=e.target)||n.contains(r);var n,r}))&&(r.dispatch("blur",null),t.debug||r.pendingRequests.cancelAll())}return vt({onTouchStart:i,onMouseDown:i,onTouchMove:function(e){!1!==r.getState().isOpen&&n===t.environment.document.activeElement&&e.target!==n&&n.blur()}},wt(e,ft))},getRootProps:function(e){return vt({role:"combobox","aria-expanded":r.getState().isOpen,"aria-haspopup":"listbox","aria-controls":r.getState().isOpen?r.getState().collections.map((function(e){var n=e.source;return we(t.id,"list",n)})).join(" "):void 0,"aria-labelledby":we(t.id,"label")},e)},getFormProps:function(e){return e.inputElement,vt({action:"",noValidate:!0,role:"search",onSubmit:function(o){var i;o.preventDefault(),t.onSubmit(vt({event:o,refresh:n,state:r.getState()},a)),r.dispatch("submit",null),null===(i=e.inputElement)||void 0===i||i.blur()},onReset:function(o){var i;o.preventDefault(),t.onReset(vt({event:o,refresh:n,state:r.getState()},a)),r.dispatch("reset",null),null===(i=e.inputElement)||void 0===i||i.focus()}},wt(e,pt))},getLabelProps:function(e){return vt({htmlFor:we(t.id,"input"),id:we(t.id,"label")},e)},getInputProps:function(e){var o;function i(e){(t.openOnFocus||Boolean(r.getState().query))&&at(vt({event:e,props:t,query:r.getState().completion||r.getState().query,refresh:n,store:r},a)),r.dispatch("focus",null)}var l=e||{};l.inputElement;var s=l.maxLength,c=void 0===s?512:s,u=wt(l,mt),d=ye(r.getState()),f=function(e){return Boolean(e&&e.match(Ee))}((null===(o=t.environment.navigator)||void 0===o?void 0:o.userAgent)||""),p=t.enterKeyHint||(null!=d&&d.itemUrl&&!f?"go":"search");return vt({"aria-autocomplete":"both","aria-activedescendant":r.getState().isOpen&&null!==r.getState().activeItemId?we(t.id,"item-".concat(r.getState().activeItemId),null==d?void 0:d.source):void 0,"aria-controls":r.getState().isOpen?r.getState().collections.map((function(e){var n=e.source;return we(t.id,"list",n)})).join(" "):void 0,"aria-labelledby":we(t.id,"label"),value:r.getState().completion||r.getState().query,id:we(t.id,"input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:p,spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:c,type:"search",onChange:function(e){var o=e.currentTarget.value;t.ignoreCompositionEvents&&Se(e).isComposing?a.setQuery(o):at(vt({event:e,props:t,query:o.slice(0,c),refresh:n,store:r},a))},onCompositionEnd:function(e){at(vt({event:e,props:t,query:e.currentTarget.value.slice(0,c),refresh:n,store:r},a))},onKeyDown:function(e){Se(e).isComposing||function(e){var t=e.event,n=e.props,r=e.refresh,a=e.store,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,it);if("ArrowUp"===t.key||"ArrowDown"===t.key){var i=function(){var e=ye(a.getState()),t=n.environment.document.getElementById(we(n.id,"item-".concat(a.getState().activeItemId),null==e?void 0:e.source));t&&(t.scrollIntoViewIfNeeded?t.scrollIntoViewIfNeeded(!1):t.scrollIntoView(!1))},l=function(){var e=ye(a.getState());if(null!==a.getState().activeItemId&&e){var n=e.item,i=e.itemInputValue,l=e.itemUrl,s=e.source;s.onActive(st({event:t,item:n,itemInputValue:i,itemUrl:l,refresh:r,source:s,state:a.getState()},o))}};t.preventDefault(),!1===a.getState().isOpen&&(n.openOnFocus||Boolean(a.getState().query))?at(st({event:t,props:n,query:a.getState().query,refresh:r,store:a},o)).then((function(){a.dispatch(t.key,{nextActiveItemId:n.defaultActiveItemId}),l(),setTimeout(i,0)})):(a.dispatch(t.key,{}),l(),i())}else if("Escape"===t.key)t.preventDefault(),a.dispatch(t.key,null),a.pendingRequests.cancelAll();else if("Tab"===t.key)a.dispatch("blur",null),a.pendingRequests.cancelAll();else if("Enter"===t.key){if(null===a.getState().activeItemId||a.getState().collections.every((function(e){return 0===e.items.length})))return void(n.debug||a.pendingRequests.cancelAll());t.preventDefault();var s=ye(a.getState()),c=s.item,u=s.itemInputValue,d=s.itemUrl,f=s.source;if(t.metaKey||t.ctrlKey)void 0!==d&&(f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:a.getState()},o)),n.navigator.navigateNewTab({itemUrl:d,item:c,state:a.getState()}));else if(t.shiftKey)void 0!==d&&(f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:a.getState()},o)),n.navigator.navigateNewWindow({itemUrl:d,item:c,state:a.getState()}));else if(t.altKey);else{if(void 0!==d)return f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:a.getState()},o)),void n.navigator.navigate({itemUrl:d,item:c,state:a.getState()});at(st({event:t,nextState:{isOpen:!1},props:n,query:u,refresh:r,store:a},o)).then((function(){f.onSelect(st({event:t,item:c,itemInputValue:u,itemUrl:d,refresh:r,source:f,state:a.getState()},o))}))}}}(vt({event:e,props:t,refresh:n,store:r},a))},onFocus:i,onBlur:j,onClick:function(n){e.inputElement!==t.environment.document.activeElement||r.getState().isOpen||i(n)}},u)},getPanelProps:function(e){return vt({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){r.dispatch("mouseleave",null)}},e)},getListProps:function(e){var n=e||{},r=n.source,a=wt(n,ht);return vt({role:"listbox","aria-labelledby":we(t.id,"label"),id:we(t.id,"list",r)},a)},getItemProps:function(e){var o=e.item,i=e.source,l=wt(e,gt);return vt({id:we(t.id,"item-".concat(o.__autocomplete_id),i),role:"option","aria-selected":r.getState().activeItemId===o.__autocomplete_id,onMouseMove:function(e){if(o.__autocomplete_id!==r.getState().activeItemId){r.dispatch("mousemove",o.__autocomplete_id);var t=ye(r.getState());if(null!==r.getState().activeItemId&&t){var i=t.item,l=t.itemInputValue,s=t.itemUrl,c=t.source;c.onActive(vt({event:e,item:i,itemInputValue:l,itemUrl:s,refresh:n,source:c,state:r.getState()},a))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var l=i.getItemInputValue({item:o,state:r.getState()}),s=i.getItemUrl({item:o,state:r.getState()});(s?Promise.resolve():at(vt({event:e,nextState:{isOpen:!1},props:t,query:l,refresh:n,store:r},a))).then((function(){i.onSelect(vt({event:e,item:o,itemInputValue:l,itemUrl:s,refresh:n,source:i,state:r.getState()},a))}))}},l)}}}function St(e){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},St(e)}function kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _t(e){for(var t=1;t0&&r.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},r.createElement("p",{className:"DocSearch-Help"},s,":"),r.createElement("ul",null,p.slice(0,3).reduce((function(e,t){return[].concat(E(e),[r.createElement("li",{key:t},r.createElement("button",{className:"DocSearch-Prefill",key:t,type:"button",onClick:function(){a.setQuery(t.toLowerCase()+" "),a.refresh(),a.inputRef.current.focus()}},t))])}),[]))),a.getMissingResultsUrl&&r.createElement("p",{className:"DocSearch-Help"},"".concat(u," "),r.createElement("a",{href:a.getMissingResultsUrl({query:a.state.query}),target:"_blank",rel:"noopener noreferrer"},f)))}var nn=["hit","attribute","tagName"];function rn(e,t){return t.split(".").reduce((function(e,t){return null!=e&&e[t]?e[t]:null}),e)}function an(e){var t=e.hit,n=e.attribute,a=e.tagName,o=void 0===a?"span":a,i=b(e,nn);return(0,r.createElement)(o,g(g({},i),{},{dangerouslySetInnerHTML:{__html:rn(t,"_snippetResult.".concat(n,".value"))||rn(t,n)}}))}function on(e){return e.collection&&0!==e.collection.items.length?r.createElement("section",{className:"DocSearch-Hits"},r.createElement("div",{className:"DocSearch-Hit-source"},e.title),r.createElement("ul",e.getListProps(),e.collection.items.map((function(t,n){return r.createElement(ln,d({key:[e.title,t.objectID].join(":"),item:t,index:n},e))})))):null}function ln(e){var t=e.item,n=e.index,a=e.renderIcon,o=e.renderAction,i=e.getItemProps,l=e.onItemClick,s=e.collection,c=e.hitComponent,u=w(r.useState(!1),2),f=u[0],p=u[1],m=w(r.useState(!1),2),h=m[0],g=m[1],b=r.useRef(null),v=c;return r.createElement("li",d({className:["DocSearch-Hit",t.__docsearch_parent&&"DocSearch-Hit--Child",f&&"DocSearch-Hit--deleting",h&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){b.current&&b.current()}},i({item:t,source:s.source,onClick:function(e){l(t,e)}})),r.createElement(v,{hit:t},r.createElement("div",{className:"DocSearch-Hit-Container"},a({item:t,index:n}),t.hierarchy[t.type]&&"lvl1"===t.type&&r.createElement("div",{className:"DocSearch-Hit-content-wrapper"},r.createElement(an,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.lvl1"}),t.content&&r.createElement(an,{className:"DocSearch-Hit-path",hit:t,attribute:"content"})),t.hierarchy[t.type]&&("lvl2"===t.type||"lvl3"===t.type||"lvl4"===t.type||"lvl5"===t.type||"lvl6"===t.type)&&r.createElement("div",{className:"DocSearch-Hit-content-wrapper"},r.createElement(an,{className:"DocSearch-Hit-title",hit:t,attribute:"hierarchy.".concat(t.type)}),r.createElement(an,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),"content"===t.type&&r.createElement("div",{className:"DocSearch-Hit-content-wrapper"},r.createElement(an,{className:"DocSearch-Hit-title",hit:t,attribute:"content"}),r.createElement(an,{className:"DocSearch-Hit-path",hit:t,attribute:"hierarchy.lvl1"})),o({item:t,runDeleteTransition:function(e){p(!0),b.current=e},runFavoriteTransition:function(e){g(!0),b.current=e}}))))}function sn(e,t,n){return e.reduce((function(e,r){var a=t(r);return e.hasOwnProperty(a)||(e[a]=[]),e[a].length<(n||5)&&e[a].push(r),e}),{})}function cn(e){return e}function un(e){return 1===e.button||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}function dn(){}var fn=/(|<\/mark>)/g,pn=RegExp(fn.source);function mn(e){var t,n,r=e;if(!r.__docsearch_parent&&!e._highlightResult)return e.hierarchy.lvl0;var a=r.__docsearch_parent?null===(t=r.__docsearch_parent)||void 0===t||null===(t=t._highlightResult)||void 0===t||null===(t=t.hierarchy)||void 0===t?void 0:t.lvl0:null===(n=e._highlightResult)||void 0===n||null===(n=n.hierarchy)||void 0===n?void 0:n.lvl0;return a?a.value&&pn.test(a.value)?a.value.replace(fn,""):a.value:e.hierarchy.lvl0}function hn(e){return r.createElement("div",{className:"DocSearch-Dropdown-Container"},e.state.collections.map((function(t){if(0===t.items.length)return null;var n=mn(t.items[0]);return r.createElement(on,d({},e,{key:t.source.sourceId,title:n,collection:t,renderIcon:function(e){var n,a=e.item,o=e.index;return r.createElement(r.Fragment,null,a.__docsearch_parent&&r.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},r.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.__docsearch_parent!==(null===(n=t.items[o+1])||void 0===n?void 0:n.__docsearch_parent)?r.createElement("path",{d:"M8 6v21M20 27H8.3"}):r.createElement("path",{d:"M8 6v42M20 27H8.3"}))),r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Wt,{type:a.type})))},renderAction:function(){return r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement(Gt,null))}}))})),e.resultsFooterComponent&&r.createElement("section",{className:"DocSearch-HitsFooter"},r.createElement(e.resultsFooterComponent,{state:e.state})))}var gn=["translations"];function bn(e){var t=e.translations,n=void 0===t?{}:t,a=b(e,gn),o=n.recentSearchesTitle,i=void 0===o?"Recent":o,l=n.noRecentSearchesText,s=void 0===l?"No recent searches":l,c=n.saveRecentSearchButtonTitle,u=void 0===c?"Save this search":c,f=n.removeRecentSearchButtonTitle,p=void 0===f?"Remove this search from history":f,m=n.favoriteSearchesTitle,h=void 0===m?"Favorite":m,g=n.removeFavoriteSearchButtonTitle,v=void 0===g?"Remove this search from favorites":g;return"idle"===a.state.status&&!1===a.hasCollections?a.disableUserPersonalization?null:r.createElement("div",{className:"DocSearch-StartScreen"},r.createElement("p",{className:"DocSearch-Help"},s)):!1===a.hasCollections?null:r.createElement("div",{className:"DocSearch-Dropdown-Container"},r.createElement(on,d({},a,{title:i,collection:a.state.collections[0],renderIcon:function(){return r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Ht,null))},renderAction:function(e){var t=e.item,n=e.runFavoriteTransition,o=e.runDeleteTransition;return r.createElement(r.Fragment,null,r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement("button",{className:"DocSearch-Hit-action-button",title:u,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){a.favoriteSearches.add(t),a.recentSearches.remove(t),a.refresh()}))}},r.createElement(Yt,null))),r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement("button",{className:"DocSearch-Hit-action-button",title:p,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),o((function(){a.recentSearches.remove(t),a.refresh()}))}},r.createElement($t,null))))}})),r.createElement(on,d({},a,{title:h,collection:a.state.collections[1],renderIcon:function(){return r.createElement("div",{className:"DocSearch-Hit-icon"},r.createElement(Yt,null))},renderAction:function(e){var t=e.item,n=e.runDeleteTransition;return r.createElement("div",{className:"DocSearch-Hit-action"},r.createElement("button",{className:"DocSearch-Hit-action-button",title:v,type:"submit",onClick:function(e){e.preventDefault(),e.stopPropagation(),n((function(){a.favoriteSearches.remove(t),a.refresh()}))}},r.createElement($t,null)))}})))}var vn=["translations"],yn=r.memo((function(e){var t=e.translations,n=void 0===t?{}:t,a=b(e,vn);if("error"===a.state.status)return r.createElement(Zt,{translations:null==n?void 0:n.errorScreen});var o=a.state.collections.some((function(e){return e.items.length>0}));return a.state.query?!1===o?r.createElement(tn,d({},a,{translations:null==n?void 0:n.noResultsScreen})):r.createElement(hn,a):r.createElement(bn,d({},a,{hasCollections:o,translations:null==n?void 0:n.startScreen}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status})),wn=["translations"];function En(e){var t=e.translations,n=void 0===t?{}:t,a=b(e,wn),o=n.resetButtonTitle,i=void 0===o?"Clear the query":o,l=n.resetButtonAriaLabel,s=void 0===l?"Clear the query":l,c=n.cancelButtonText,u=void 0===c?"Cancel":c,f=n.cancelButtonAriaLabel,p=void 0===f?"Cancel":f,m=n.searchInputLabel,h=void 0===m?"Search":m,g=a.getFormProps({inputElement:a.inputRef.current}).onReset;return r.useEffect((function(){a.autoFocus&&a.inputRef.current&&a.inputRef.current.focus()}),[a.autoFocus,a.inputRef]),r.useEffect((function(){a.isFromSelection&&a.inputRef.current&&a.inputRef.current.select()}),[a.isFromSelection,a.inputRef]),r.createElement(r.Fragment,null,r.createElement("form",{className:"DocSearch-Form",onSubmit:function(e){e.preventDefault()},onReset:g},r.createElement("label",d({className:"DocSearch-MagnifierLabel"},a.getLabelProps()),r.createElement(O,null),r.createElement("span",{className:"DocSearch-VisuallyHiddenForAccessibility"},h)),r.createElement("div",{className:"DocSearch-LoadingIndicator"},r.createElement(qt,null)),r.createElement("input",d({className:"DocSearch-Input",ref:a.inputRef},a.getInputProps({inputElement:a.inputRef.current,autoFocus:a.autoFocus,maxLength:64}))),r.createElement("button",{type:"reset",title:i,className:"DocSearch-Reset","aria-label":s,hidden:!a.state.query},r.createElement($t,null))),r.createElement("button",{className:"DocSearch-Cancel",type:"reset","aria-label":p,onClick:a.onClose},u))}var Sn=["_highlightResult","_snippetResult"];function kn(e){var t=e.key,n=e.limit,r=void 0===n?5:n,a=function(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(e){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}(t),o=a.getItem().slice(0,r);return{add:function(e){var t=e;t._highlightResult,t._snippetResult;var n=b(t,Sn),i=o.findIndex((function(e){return e.objectID===n.objectID}));i>-1&&o.splice(i,1),o.unshift(n),o=o.slice(0,r),a.setItem(o)},remove:function(e){o=o.filter((function(t){return t.objectID!==e.objectID})),a.setItem(o)},getAll:function(){return o}}}function _n(e){var t,n="algolia-client-js-".concat(e.key);function r(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(r().getItem(n)||"{}")}function o(e){r().setItem(n,JSON.stringify(e))}return{get:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var n,r,i;return n=e.timeToLive?1e3*e.timeToLive:null,r=a(),o(i=Object.fromEntries(Object.entries(r).filter((function(e){return void 0!==w(e,2)[1].timestamp})))),n&&o(Object.fromEntries(Object.entries(i).filter((function(e){var t=w(e,2)[1],r=(new Date).getTime();return!(t.timestamp+n2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,n.miss(e)])})).then((function(e){return w(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,a).catch((function(){return On({caches:t}).get(e,r,a)}))},set:function(e,r){return n.set(e,r).catch((function(){return On({caches:t}).set(e,r)}))},delete:function(e){return n.delete(e).catch((function(){return On({caches:t}).delete(e)}))},clear:function(){return n.clear().catch((function(){return On({caches:t}).clear()}))}}}function xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},o=JSON.stringify(n);if(o in t)return Promise.resolve(e.serializable?JSON.parse(t[o]):t[o]);var i=r();return i.then((function(e){return a.miss(e)})).then((function(){return i}))},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function An(e){var t=e.algoliaAgents,n=e.client,r=e.version,a=function(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var n="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(n)&&(t.value="".concat(t.value).concat(n)),t}};return t}(r).add({segment:n,version:r});return t.forEach((function(e){return a.add(e)})),a}var Cn=12e4;function Tn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"up",n=Date.now();return g(g({},e),{},{status:t,lastUpdate:n,isUp:function(){return"up"===t||Date.now()-n>Cn},isTimedOut:function(){return"timed out"===t&&Date.now()-n<=Cn}})}var Pn=function(){function e(t,n){var r;return s(this,e),u(r=l(this,e,[t]),"name","AlgoliaError"),n&&(r.name=n),r}return p(e,k(Error)),c(e)}(),In=function(){function e(t,n,r){var a;return s(this,e),u(a=l(this,e,[t,r]),"stackTrace",void 0),a.stackTrace=n,a}return p(e,Pn),c(e)}(),Ln=function(){function e(t){return s(this,e),l(this,e,["Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",t,"RetryError"])}return p(e,In),c(e)}(),Dn=function(){function e(t,n,r){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ApiError";return s(this,e),u(a=l(this,e,[t,r,o]),"status",void 0),a.status=n,a}return p(e,In),c(e)}(),Rn=function(){function e(t,n){var r;return s(this,e),u(r=l(this,e,[t,"DeserializationError"]),"response",void 0),r.response=n,r}return p(e,Pn),c(e)}(),Nn=function(){function e(t,n,r,a){var o;return s(this,e),u(o=l(this,e,[t,n,a,"DetailedApiError"]),"error",void 0),o.error=r,o}return p(e,Dn),c(e)}();function jn(e,t,n){var r,a=(r=n,Object.keys(r).filter((function(e){return void 0!==r[e]})).sort().map((function(e){return"".concat(e,"=").concat(encodeURIComponent("[object Array]"===Object.prototype.toString.call(r[e])?r[e].join(","):r[e]).replace(/\+/g,"%20"))})).join("&")),o="".concat(e.protocol,"://").concat(e.url).concat(e.port?":".concat(e.port):"","/").concat("/"===t.charAt(0)?t.substring(1):t);return a.length&&(o+="?".concat(a)),o}function Mn(e,t){if("GET"!==e.method&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:g(g({},e.data),t.data);return JSON.stringify(n)}}function Fn(e,t,n){var r=g(g(g({Accept:"application/json"},e),t),n),a={};return Object.keys(r).forEach((function(e){var t=r[e];a[e.toLowerCase()]=t})),a}function Bn(e){try{return JSON.parse(e.content)}catch(t){throw new Rn(t.message,e)}}function Un(e,t){var n=e.content,r=e.status;try{var a=JSON.parse(n);return"error"in a?new Nn(a.message,r,a.error,t):new Dn(a.message,r,t)}catch(e){}return new Dn(n,r,t)}function zn(e){return e.map((function(e){return qn(e)}))}function qn(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return g(g({},e),{},{request:g(g({},e.request),{},{headers:g(g({},e.request.headers),t)})})}var Hn=["appId","apiKey","authMode","algoliaAgents"],$n=["params"],Gn="5.12.0";function Vn(e){return[{url:"".concat(e,"-dsn.algolia.net"),accept:"read",protocol:"https"},{url:"".concat(e,".algolia.net"),accept:"write",protocol:"https"}].concat(function(e){for(var t=e,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),a=e[n];t[n]=e[r],t[r]=a}return t}([{url:"".concat(e,"-1.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-2.algolianet.com"),accept:"readWrite",protocol:"https"},{url:"".concat(e,"-3.algolianet.com"),accept:"readWrite",protocol:"https"}]))}var Wn="3.7.0";function Kn(e,t,n){return r.useMemo((function(){var r=function(e,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!t||"string"!=typeof t)throw new Error("`apiKey` is missing.");return function(e){var t=e.appId,n=e.apiKey,r=e.authMode,a=e.algoliaAgents,o=b(e,Hn),l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"WithinHeaders",r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:function(){return"WithinHeaders"===n?r:{}},queryParameters:function(){return"WithinQueryParameters"===n?r:{}}}}(t,n,r),s=function(e){var t=e.hosts,n=e.hostsCache,r=e.baseHeaders,a=e.logger,o=e.baseQueryParameters,l=e.algoliaAgent,s=e.timeouts,c=e.requester,u=e.requestsCache,d=e.responsesCache;function f(e){return p.apply(this,arguments)}function p(){return(p=i(v().mark((function e(t){var r,a,o,i,l;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map((function(e){return n.get(e,(function(){return Promise.resolve(Tn(e))}))})));case 2:return r=e.sent,a=r.filter((function(e){return e.isUp()})),o=r.filter((function(e){return e.isTimedOut()})),i=[].concat(E(a),E(o)),l=i.length>0?i:t,e.abrupt("return",{hosts:l,getTimeout:function(e,t){return(0===o.length&&0===e?1:o.length+3+e)*t}});case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e,t){return h.apply(this,arguments)}function h(){return h=i(v().mark((function e(u,d){var p,m,h,b,y,w,S,k,_,O,x,A,C,T=arguments;return v().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(p=!(T.length>2&&void 0!==T[2])||T[2],m=[],h=Mn(u,d),b=Fn(r,u.headers,d.headers),y="GET"===u.method?g(g({},u.data),d.data):{},w=g(g(g({},o),u.queryParameters),y),l.value&&(w["x-algolia-agent"]=l.value),d&&d.queryParameters)for(S=0,k=Object.keys(d.queryParameters);S1&&void 0!==arguments[1]?arguments[1]:{},n=e.useReadTransporter||"GET"===e.method;if(!n)return m(e,t,n);var a=function(){return m(e,t)};if(!0!==(t.cacheable||e.cacheable))return a();var i={request:e,requestOptions:t,transporter:{queryParameters:o,headers:r}};return d.get(i,(function(){return u.get(i,(function(){return u.set(i,a()).then((function(e){return Promise.all([u.delete(i),e])}),(function(e){return Promise.all([u.delete(i),Promise.reject(e)])})).then((function(e){var t=w(e,2);return t[0],t[1]}))}))}),{miss:function(e){return d.set(i,e)}})},requestsCache:u,responsesCache:d}}(g(g({hosts:Vn(t)},o),{},{algoliaAgent:An({algoliaAgents:a,client:"Lite",version:Gn}),baseHeaders:g(g({"content-type":"text/plain"},l.headers()),o.baseHeaders),baseQueryParameters:g(g({},l.queryParameters()),o.baseQueryParameters)}));return{transporter:s,appId:t,clearCache:function(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then((function(){}))},get _ua(){return s.algoliaAgent.value},addAlgoliaAgent:function(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey:function(e){var t=e.apiKey;r&&"WithinHeaders"!==r?s.baseQueryParameters["x-algolia-api-key"]=t:s.baseHeaders["x-algolia-api-key"]=t},searchForHits:function(e,t){return this.search(e,t)},searchForFacets:function(e,t){return this.search(e,t)},customPost:function(e,t){var n=e.path,r=e.parameters,a=e.body;if(!n)throw new Error("Parameter `path` is required when calling `customPost`.");var o={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:r||{},headers:{},data:a||{}};return s.request(o,t)},getRecommendations:function(e,t){if(e&&Array.isArray(e)&&(e={requests:e}),!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");var n={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)},search:function(e,t){if(e&&Array.isArray(e)){var n={requests:e.map((function(e){var t=e.params,n=b(e,$n);return"facet"===n.type?g(g(g({},n),t),{},{type:"facet"}):g(g(g({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}))};e=n}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");var r={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(r,t)}}}(g({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},requester:{send:function(e){return new Promise((function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return n.setRequestHeader(t,e.headers[t])}));var r,a=function(e,r){return setTimeout((function(){n.abort(),t({status:0,content:r,isTimedOut:!0})}),e)},o=a(e.connectTimeout,"Connection timeout");n.onreadystatechange=function(){n.readyState>n.OPENED&&void 0===r&&(clearTimeout(o),r=a(e.responseTimeout,"Socket timeout"))},n.onerror=function(){0===n.status&&(clearTimeout(o),clearTimeout(r),t({content:n.responseText||"Network request failed",status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(o),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:xn(),requestsCache:xn({serializable:!1}),hostsCache:On({caches:[_n({key:"".concat(Gn,"-").concat(e)}),xn()]})},void 0))}(e,t);return r.addAlgoliaAgent("docsearch",Wn),!1===/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)&&r.addAlgoliaAgent("docsearch-react",Wn),n(r)}),[e,t,n])}var Qn=["footer","searchBox"];function Yn(e){var t=e.appId,n=e.apiKey,a=e.indexName,o=e.placeholder,i=void 0===o?"Search docs":o,l=e.searchParameters,s=e.maxResultsPerGroup,c=e.onClose,u=void 0===c?dn:c,f=e.transformItems,p=void 0===f?cn:f,m=e.hitComponent,h=void 0===m?zt:m,v=e.resultsFooterComponent,y=void 0===v?function(){return null}:v,E=e.navigator,S=e.initialScrollY,k=void 0===S?0:S,_=e.transformSearchClient,O=void 0===_?cn:_,x=e.disableUserPersonalization,A=void 0!==x&&x,C=e.initialQuery,T=void 0===C?"":C,P=e.translations,I=void 0===P?{}:P,L=e.getMissingResultsUrl,D=e.insights,R=void 0!==D&&D,N=I.footer,j=I.searchBox,M=b(I,Qn),F=w(r.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),B=F[0],U=F[1],z=r.useRef(null),q=r.useRef(null),H=r.useRef(null),$=r.useRef(null),G=r.useRef(null),V=r.useRef(10),W=r.useRef("undefined"!=typeof window?window.getSelection().toString().slice(0,64):"").current,K=r.useRef(T||W).current,Q=Kn(t,n,O),Y=r.useRef(kn({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(a),limit:10})).current,X=r.useRef(kn({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(a),limit:0===Y.getAll().length?7:4})).current,J=r.useCallback((function(e){if(!A){var t="content"===e.type?e.__docsearch_parent:e;t&&-1===Y.getAll().findIndex((function(e){return e.objectID===t.objectID}))&&X.add(t)}}),[Y,X,A]),Z=r.useCallback((function(e){if(B.context.algoliaInsightsPlugin&&e.__autocomplete_id){var t=e,n={eventName:"Item Selected",index:t.__autocomplete_indexName,items:[t],positions:[e.__autocomplete_id],queryID:t.__autocomplete_queryID};B.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(n)}}),[B.context.algoliaInsightsPlugin]),ee=r.useMemo((function(){return Mt({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:K,context:{searchSuggestions:[]}},insights:R,navigator:E,onStateChange:function(e){U(e.state)},getSources:function(e){var r=e.query,o=e.state,i=e.setContext,c=e.setStatus;if(!r)return A?[]:[{sourceId:"recentSearches",onSelect:function(e){var t=e.item,n=e.event;J(t),un(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return X.getAll()}},{sourceId:"favoriteSearches",onSelect:function(e){var t=e.item,n=e.event;J(t),un(n)||u()},getItemUrl:function(e){return e.item.url},getItems:function(){return Y.getAll()}}];var d=Boolean(R);return Q.search({requests:[g({query:r,indexName:a,attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(V.current),"hierarchy.lvl2:".concat(V.current),"hierarchy.lvl3:".concat(V.current),"hierarchy.lvl4:".concat(V.current),"hierarchy.lvl5:".concat(V.current),"hierarchy.lvl6:".concat(V.current),"content:".concat(V.current)],snippetEllipsisText:"\u2026",highlightPreTag:"",highlightPostTag:"",hitsPerPage:20,clickAnalytics:d},l)]}).catch((function(e){throw"RetryError"===e.name&&c("error"),e})).then((function(e){var r=e.results[0],l=r.hits,c=r.nbHits,f=sn(l,(function(e){return mn(e)}),s);o.context.searchSuggestions.length0&&(re(),G.current&&G.current.focus())}),[K,re]),r.useEffect((function(){function e(){if(q.current){var e=.01*window.innerHeight;q.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),r.createElement("div",d({ref:z},ne({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===B.status&&"DocSearch-Container--Stalled","error"===B.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),role:"button",tabIndex:0,onMouseDown:function(e){e.target===e.currentTarget&&u()}}),r.createElement("div",{className:"DocSearch-Modal",ref:q},r.createElement("header",{className:"DocSearch-SearchBar",ref:H},r.createElement(En,d({},ee,{state:B,autoFocus:0===K.length,inputRef:G,isFromSelection:Boolean(K)&&K===W,translations:j,onClose:u}))),r.createElement("div",{className:"DocSearch-Dropdown",ref:$},r.createElement(yn,d({},ee,{indexName:a,state:B,hitComponent:h,resultsFooterComponent:y,disableUserPersonalization:A,recentSearches:X,favoriteSearches:Y,inputRef:G,translations:M,getMissingResultsUrl:L,onItemClick:function(e,t){Z(e),J(e),un(t)||u()}}))),r.createElement("footer",{className:"DocSearch-Footer"},r.createElement(Ut,{translations:N}))))}function Xn(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){var r;if("Escape"===e.code&&t||"k"===(null===(r=e.key)||void 0===r?void 0:r.toLowerCase())&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)return e.preventDefault(),void(t?a():document.body.classList.contains("DocSearch--active")||n());i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}},8328:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(6540),a=n(8168),o=n(3259),i=n.n(o),l=n(4054);const s={"015e0bf7":[()=>n.e(2775).then(n.bind(n,3635)),"@site/docs/api/classes/heap_analysis_src.StringAnalysis.md",3635],"086eefc4":[()=>n.e(6192).then(n.bind(n,473)),"@site/docs/api/classes/api_src.SnapshotResultReader.md",473],"0d63082f":[()=>n.e(5214).then(n.bind(n,6835)),"@site/docs/api/classes/heap_analysis_src.BaseAnalysis.md",6835],"0e384e19":[()=>n.e(3976).then(n.bind(n,8386)),"@site/docs/intro.md",8386],"0ee6ea57":[()=>n.e(4573).then(n.bind(n,1471)),"@site/docs/api/interfaces/core_src.IHeapNode.md",1471],17896441:[()=>Promise.all([n.e(1869),n.e(2329),n.e(2025),n.e(8401)]).then(n.bind(n,2384)),"@theme/DocItem",2384],"1a4e3797":[()=>Promise.all([n.e(1869),n.e(2138)]).then(n.bind(n,6996)),"@theme/SearchPage",6996],"1a5ddf9d":[()=>n.e(2871).then(n.bind(n,3179)),"@site/docs/guides/03-find-leak.md",3179],"1bb76b7a":[()=>n.e(2915).then(n.bind(n,1835)),"@site/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis.md",1835],"1be78505":[()=>Promise.all([n.e(1869),n.e(8714)]).then(n.bind(n,8067)),"@theme/DocPage",8067],"1df93b7f":[()=>Promise.all([n.e(1869),n.e(5491),n.e(4583)]).then(n.bind(n,7379)),"@site/src/pages/index.tsx",7379],"1f391b9e":[()=>Promise.all([n.e(1869),n.e(2329),n.e(2025),n.e(6061)]).then(n.bind(n,7973)),"@theme/MDXPage",7973],"226aeb7c":[()=>n.e(5427).then(n.t.bind(n,1966,19)),"/home/runner/work/memlab/memlab/website/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",1966],"26eba521":[()=>n.e(6571).then(n.bind(n,7167)),"@site/docs/api/modules/core_src.md",7167],"27652c34":[()=>n.e(8417).then(n.bind(n,7806)),"@site/docs/api/interfaces/core_src.IHeapStringNode.md",7806],"2a2a772b":[()=>n.e(1901).then(n.bind(n,5462)),"@site/docs/cli/CLI-commands.md",5462],"2d8affd8":[()=>n.e(8032).then(n.bind(n,4711)),"@site/docs/api/enums/api_src.ConsoleMode.md",4711],"2ecac66d":[()=>n.e(1797).then(n.bind(n,4236)),"@site/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis.md",4236],"3531de3b":[()=>n.e(9477).then(n.bind(n,205)),"@site/docs/api/interfaces/core_src.IBrowserInfo.md",205],"38ea947a":[()=>n.e(9063).then(n.bind(n,3745)),"@site/src/pages/under-construction.md",3745],"3b8c55ea":[()=>n.e(6803).then(n.bind(n,3414)),"@site/docs/installation.md",3414],"44ba4ae6":[()=>n.e(8796).then(n.bind(n,4976)),"@site/docs/how-memlab-works.md",4976],"4527bbe9":[()=>n.e(2625).then(n.bind(n,5573)),"@site/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis.md",5573],"5a17db6f":[()=>n.e(8807).then(n.bind(n,540)),"@site/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis.md",540],"5b1d4bc5":[()=>n.e(9439).then(n.bind(n,513)),"@site/docs/api/modules/heap_analysis_src.md",513],"5be78946":[()=>n.e(8485).then(n.bind(n,8652)),"@site/docs/api/interfaces/core_src.ILeakFilter.md",8652],"5e82d739":[()=>Promise.all([n.e(1869),n.e(2329),n.e(4612)]).then(n.bind(n,2078)),"@site/docs/guides/01-detached-dom.mdx",2078],"5e8c322a":[()=>n.e(594).then(n.bind(n,4583)),"@site/docs/api/index.md",4583],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,4784)),"@generated/docusaurus.config",4784],"6b5d7254":[()=>n.e(9548).then(n.bind(n,45)),"@site/docs/api/interfaces/core_src.IHeapEdges.md",45],"72eddb53":[()=>n.e(1473).then(n.bind(n,8345)),"@site/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis.md",8345],"8b21a35a":[()=>n.e(6640).then(n.bind(n,1416)),"@site/docs/api/modules/api_src.md",1416],"8ea95162":[()=>Promise.all([n.e(1869),n.e(2329),n.e(3474)]).then(n.bind(n,1208)),"@site/docs/guides/02-detect-oversized-object.mdx",1208],"935f2afb":[()=>n.e(8581).then(n.t.bind(n,5610,19)),"~docs/default/version-current-metadata-prop-751.json",5610],95206942:[()=>n.e(2522).then(n.bind(n,3485)),"@site/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis.md",3485],"95f47cf5":[()=>n.e(7130).then(n.bind(n,6960)),"@site/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis.md",6960],"98c9c166":[()=>n.e(984).then(n.bind(n,2182)),"@site/docs/api/interfaces/core_src.IHeapEdge.md",2182],a3bf9775:[()=>n.e(211).then(n.t.bind(n,7757,19)),"/home/runner/work/memlab/memlab/website/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7757],a7a28a68:[()=>n.e(7029).then(n.t.bind(n,4061,19)),"/home/runner/work/memlab/memlab/website/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",4061],b53f1d78:[()=>n.e(3925).then(n.bind(n,9760)),"@site/docs/api/interfaces/core_src.IHeapLocation.md",9760],c90dd339:[()=>n.e(1456).then(n.bind(n,9511)),"@site/docs/api/interfaces/core_src.IHeapSnapshot.md",9511],d589d3a7:[()=>n.e(7924).then(n.bind(n,380)),"@site/docs/getting-started.md",380],e012388a:[()=>n.e(8953).then(n.bind(n,3938)),"@site/docs/api/interfaces/core_src.IHeapNodes.md",3938],e4c6f3cc:[()=>n.e(9600).then(n.bind(n,9135)),"@site/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis.md",9135],eb14f245:[()=>n.e(2076).then(n.bind(n,6077)),"@site/docs/guides/04-continuous-test.md",6077],f40f92ec:[()=>n.e(346).then(n.bind(n,8857)),"@site/docs/api/classes/api_src.BrowserInteractionResultReader.md",8857],f6f71b0f:[()=>n.e(9901).then(n.bind(n,4369)),"@site/docs/guides/05-integrate-with-E2E-frameworks.md",4369],f8599c11:[()=>n.e(233).then(n.bind(n,4534)),"@site/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis.md",4534],fc5c0a35:[()=>n.e(9539).then(n.bind(n,9319)),"@site/docs/api/interfaces/core_src.IScenario.md",9319]};function c(e){let{error:t,retry:n,pastDelay:a}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):a?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(6921),d=n(3102);function f(e,t){if("*"===e)return i()({loading:c,loader:()=>n.e(1774).then(n.bind(n,1774)),modules:["@theme/NotFound"],webpack:()=>[1774],render(e,t){const n=e.default;return r.createElement(d.W,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const o=l[`${e}-${t}`],f={},p=[],m=[],h=(0,u.A)(o);return Object.entries(h).forEach((e=>{let[t,n]=e;const r=s[n];r&&(f[t]=r[0],p.push(r[1]),m.push(r[2]))})),i().Map({loading:c,loader:f,modules:p,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(o));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let o=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{o=o[e]})),o[l[l.length-1]]=a}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.W,{value:s},r.createElement(l,(0,a.A)({},i,n)))}})}const p=[{path:"/memlab/search",component:f("/memlab/search","9cb"),exact:!0},{path:"/memlab/under-construction",component:f("/memlab/under-construction","92a"),exact:!0},{path:"/memlab/docs",component:f("/memlab/docs","175"),routes:[{path:"/memlab/docs/api/",component:f("/memlab/docs/api/","308"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/api_src.BrowserInteractionResultReader",component:f("/memlab/docs/api/classes/api_src.BrowserInteractionResultReader","433"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/api_src.SnapshotResultReader",component:f("/memlab/docs/api/classes/api_src.SnapshotResultReader","f6c"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.BaseAnalysis","cae"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.CollectionsHoldingStaleAnalysis","2a5"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.DetachedDOMElementAnalysis","18b"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.GlobalVariableAnalysis","0a7"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.ObjectFanoutAnalysis","4bf"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.ObjectShallowAnalysis","d8e"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.ObjectShapeAnalysis","f65"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.ObjectSizeAnalysis","fb4"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.ObjectUnboundGrowthAnalysis","a44"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.ShapeUnboundGrowthAnalysis","283"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/classes/heap_analysis_src.StringAnalysis",component:f("/memlab/docs/api/classes/heap_analysis_src.StringAnalysis","ef6"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/enums/api_src.ConsoleMode",component:f("/memlab/docs/api/enums/api_src.ConsoleMode","9de"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IBrowserInfo",component:f("/memlab/docs/api/interfaces/core_src.IBrowserInfo","4ba"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapEdge",component:f("/memlab/docs/api/interfaces/core_src.IHeapEdge","26a"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapEdges",component:f("/memlab/docs/api/interfaces/core_src.IHeapEdges","d0e"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapLocation",component:f("/memlab/docs/api/interfaces/core_src.IHeapLocation","0e3"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapNode",component:f("/memlab/docs/api/interfaces/core_src.IHeapNode","8bb"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapNodes",component:f("/memlab/docs/api/interfaces/core_src.IHeapNodes","123"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapSnapshot",component:f("/memlab/docs/api/interfaces/core_src.IHeapSnapshot","c89"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IHeapStringNode",component:f("/memlab/docs/api/interfaces/core_src.IHeapStringNode","1a5"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.ILeakFilter",component:f("/memlab/docs/api/interfaces/core_src.ILeakFilter","e20"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/interfaces/core_src.IScenario",component:f("/memlab/docs/api/interfaces/core_src.IScenario","b01"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/modules/api_src",component:f("/memlab/docs/api/modules/api_src","e99"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/modules/core_src",component:f("/memlab/docs/api/modules/core_src","7fe"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/api/modules/heap_analysis_src",component:f("/memlab/docs/api/modules/heap_analysis_src","531"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/cli/CLI-commands",component:f("/memlab/docs/cli/CLI-commands","2df"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/getting-started",component:f("/memlab/docs/getting-started","f0e"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/guides/guides-detached-dom",component:f("/memlab/docs/guides/guides-detached-dom","dba"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/guides/guides-detect-oversized-object",component:f("/memlab/docs/guides/guides-detect-oversized-object","507"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/guides/guides-find-leaks",component:f("/memlab/docs/guides/guides-find-leaks","407"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/guides/integrate-with-e2e-frameworks",component:f("/memlab/docs/guides/integrate-with-e2e-frameworks","2c6"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/guides/integration-and-file-structure",component:f("/memlab/docs/guides/integration-and-file-structure","a4b"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/how-memlab-works",component:f("/memlab/docs/how-memlab-works","530"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/installation",component:f("/memlab/docs/installation","d98"),exact:!0,sidebar:"sidebar"},{path:"/memlab/docs/intro",component:f("/memlab/docs/intro","a4c"),exact:!0,sidebar:"sidebar"}]},{path:"/memlab/",component:f("/memlab/","82d"),exact:!0},{path:"*",component:f("*")}]},6125:(e,t,n)=>{"use strict";n.d(t,{o:()=>a,x:()=>o});var r=n(6540);const a=r.createContext(!1);function o(e){let{children:t}=e;const[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{o(!0)}),[]),r.createElement(a.Provider,{value:n},t)}},5660:(e,t,n)=>{"use strict";var r=n(6540),a=n(961),o=n(4625),i=n(545),l=n(8193);const s=[n(119),n(6134),n(435),n(6294),n(1043),n(1911)];var c=n(8328),u=n(6347),d=n(2831);function f(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var p=n(8168),m=n(5260),h=n(4586),g=n(6025),b=n(2131),v=n(6342),y=n(4090),w=n(9024),E=n(2967),S=n(1463);function k(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,h.A)(),n=(0,b.o)();return r.createElement(m.A,null,Object.entries(t).map((e=>{let[t,{htmlLang:a}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:a})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function _(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,h.A)(),a=function(){const{siteConfig:{url:e}}=(0,h.A)(),{pathname:t}=(0,u.zy)();return e+(0,g.A)(t)}(),o=t?`${n}${t}`:a;return r.createElement(m.A,null,r.createElement("meta",{property:"og:url",content:o}),r.createElement("link",{rel:"canonical",href:o}))}function O(){const{i18n:{currentLocale:e}}=(0,h.A)(),{metadata:t,image:n}=(0,v.p)();return r.createElement(r.Fragment,null,r.createElement(m.A,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:y.w})),n&&r.createElement(w.be,{image:n}),r.createElement(_,null),r.createElement(k,null),r.createElement(S.A,{tag:E.Cy,locale:e}),r.createElement(m.A,null,t.map(((e,t)=>r.createElement("meta",(0,p.A)({key:t},e))))))}const x=new Map;function A(e){if(x.has(e.pathname))return{...e,pathname:x.get(e.pathname)};if((0,d.u)(c.A,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return x.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return x.set(e.pathname,t),{...e,pathname:t}}var C=n(6125),T=n(6337);function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{const r=t.default?.[e]??t[e];return r?.(...n)}));return()=>a.forEach((e=>e?.()))}const I=function(e){let{children:t,location:n,previousLocation:a}=e;return(0,r.useLayoutEffect)((()=>{a!==n&&(a&&function(e){const{hash:t}=e;if(t){const e=decodeURIComponent(t.substring(1)),n=document.getElementById(e);n?.scrollIntoView()}else window.scrollTo(0,0)}(n),P("onRouteDidUpdate",{previousLocation:a,location:n}))}),[a,n]),t};function L(e){const t=(0,d.u)(c.A,e);return Promise.all(t.map((e=>e.route.component.preload?.())))}class D extends r.Component{previousLocation;routeUpdateCleanupCb;constructor(e){super(e),this.previousLocation=null,this.routeUpdateCleanupCb=l.A.canUseDOM?P("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=P("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),L(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>console.warn(e))),!1}render(){const{children:e,location:t}=this.props;return r.createElement(I,{previousLocation:this.previousLocation,location:t},r.createElement(u.qh,{location:t,render:()=>e}))}}const R=D,N="docusaurus-base-url-issue-banner-container",j="docusaurus-base-url-issue-banner-suggestion-container",M="__DOCUSAURUS_INSERT_BASEURL_BANNER";function F(e){return`\nwindow['${M}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${M}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${N}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{window[M]=!1}),[]),r.createElement(r.Fragment,null,!l.A.canUseDOM&&r.createElement(m.A,null,r.createElement("script",null,F(e))),r.createElement("div",{id:N}))}function U(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,h.A)(),{pathname:n}=(0,u.zy)();return t&&n===e?r.createElement(B,null):null}function z(){const{siteConfig:{favicon:e,title:t},i18n:{currentLocale:n,localeConfigs:a}}=(0,h.A)(),o=(0,g.A)(e),{htmlLang:i,direction:l}=a[n];return r.createElement(m.A,null,r.createElement("html",{lang:i,dir:l}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),e&&r.createElement("link",{rel:"icon",href:o}))}var q=n(7489);function H(){const e=(0,d.v)(c.A),t=(0,u.zy)();return r.createElement(q.A,null,r.createElement(T.l,null,r.createElement(C.x,null,r.createElement(f,null,r.createElement(z,null),r.createElement(O,null),r.createElement(U,null),r.createElement(R,{location:A(t)},e)))))}var $=n(4054);const G=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{if("undefined"==typeof document)return void n();const r=document.createElement("link");r.setAttribute("rel","prefetch"),r.setAttribute("href",e),r.onload=()=>t(),r.onerror=()=>n();const a=document.getElementsByTagName("head")[0]??document.getElementsByName("script")[0]?.parentNode;a?.appendChild(r)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var V=n(6921);const W=new Set,K=new Set,Q=()=>navigator.connection?.effectiveType.includes("2g")||navigator.connection?.saveData,Y={prefetch(e){if(!(e=>!Q()&&!K.has(e)&&!W.has(e))(e))return!1;W.add(e);const t=(0,d.u)(c.A,e).flatMap((e=>{return t=e.route.path,Object.entries($).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,V.A)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?G(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!Q()&&!K.has(e))(e)&&(K.add(e),L(e))},X=Object.freeze(Y);if(l.A.canUseDOM){window.docusaurus=X;const e=a.hydrate;L(window.location.pathname).then((()=>{e(r.createElement(i.vd,null,r.createElement(o.Kd,null,r.createElement(H,null))),document.getElementById("__docusaurus"))}))}},6337:(e,t,n)=>{"use strict";n.d(t,{o:()=>u,l:()=>d});var r=n(6540),a=n(4784),o=n(9568);const i=JSON.parse('{"defaultLocale":"en","locales":["en"],"currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory"}}}');var l=n(2654);const s=JSON.parse('{"docusaurusVersion":"2.0.0-beta.21","siteVersion":"1.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.0.0-beta.21"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.0.0-beta.21"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.0.0-beta.21"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.0.0-beta.21"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.0.0-beta.21"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"2.0.0-beta.21"},"docusaurus-plugin-typedoc":{"type":"package","name":"@memlab/memlab-docusaurus-plugin-typedoc","version":"0.17.9"},"docusaurus-plugin-google-gtag":{"type":"package","name":"@docusaurus/plugin-google-gtag","version":"2.0.0-beta.21"}}}'),c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},7489:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(6540),a=n(8193),o=n(5260),i=n(8916);function l(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"50vh",width:"100%",fontSize:"20px"}},r.createElement("h1",null,"This page crashed."),r.createElement("p",null,t.message),r.createElement("button",{type:"button",onClick:n},"Try again"))}function s(e){let{error:t,tryAgain:n}=e;return r.createElement(u,{fallback:()=>r.createElement(l,{error:t,tryAgain:n})},r.createElement(o.A,null,r.createElement("title",null,"Page Error")),r.createElement(i.A,null,r.createElement(l,{error:t,tryAgain:n})))}const c=e=>r.createElement(s,e);class u extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.A.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??c)(e)}return e??null}}},8193:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=!("undefined"==typeof window||!window.document||!window.document.createElement),a={canUseDOM:r,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&!!window.screen}},5260:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(545);function o(e){return r.createElement(a.mg,e)}},5489:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(8168),a=n(6540),o=n(4625),i=n(440),l=n(4586),s=n(6654),c=n(8193);const u=a.createContext({collectLink:()=>{}});var d=n(6025);function f(e,t){let{isNavLink:n,to:f,href:p,activeClassName:m,isActive:h,"data-noBrokenLinkCheck":g,autoAddBaseUrl:b=!0,...v}=e;const{siteConfig:{trailingSlash:y,baseUrl:w}}=(0,l.A)(),{withBaseUrl:E}=(0,d.h)(),S=(0,a.useContext)(u),k=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(()=>k.current));const _=f||p;const O=(0,s.A)(_),x=_?.replace("pathname://","");let A=void 0!==x?(C=x,b&&(e=>e.startsWith("/"))(C)?E(C):C):void 0;var C;A&&O&&(A=(0,i.applyTrailingSlash)(A,{trailingSlash:y,baseUrl:w}));const T=(0,a.useRef)(!1),P=n?o.k2:o.N_,I=c.A.canUseIntersectionObserver,L=(0,a.useRef)();(0,a.useEffect)((()=>(!I&&O&&null!=A&&window.docusaurus.prefetch(A),()=>{I&&L.current&&L.current.disconnect()})),[L,A,I,O]);const D=A?.startsWith("#")??!1,R=!A||!O||D;return R||g||S.collectLink(A),R?a.createElement("a",(0,r.A)({ref:k,href:A},_&&!O&&{target:"_blank",rel:"noopener noreferrer"},v)):a.createElement(P,(0,r.A)({},v,{onMouseEnter:()=>{T.current||null==A||(window.docusaurus.preload(A),T.current=!0)},innerRef:e=>{k.current=e,I&&e&&O&&(L.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(L.current.unobserve(e),L.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),L.current.observe(e))},to:A},n&&{isActive:h,activeClassName:m}))}const p=a.forwardRef(f)},1312:(e,t,n)=>{"use strict";n.d(t,{A:()=>s,T:()=>l});var r=n(6540);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=t?.[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var o=n(2654);function i(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return o[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(i({message:n,id:r}),t)}function s(e){let{children:t,id:n,values:o}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const l=i({message:t,id:n});return r.createElement(r.Fragment,null,a(l,o))}},7065:(e,t,n)=>{"use strict";n.d(t,{W:()=>r});const r="default"},6654:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{A:()=>a,z:()=>r})},6025:(e,t,n)=>{"use strict";n.d(t,{A:()=>i,h:()=>o});var r=n(4586),a=n(6654);function o(){const{siteConfig:{baseUrl:e,url:t}}=(0,r.A)();return{withBaseUrl:(n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:o=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,a.z)(n))return n;if(o)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)}}function i(e,t){void 0===t&&(t={});const{withBaseUrl:n}=o();return n(e,t)}},4586:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6337);function o(){return(0,r.useContext)(a.o)}},2303:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(6125);function o(){return(0,r.useContext)(a.o)}},6921:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});const r=e=>"object"==typeof e&&!!e&&Object.keys(e).length>0;function a(e){const t={};return function e(n,a){Object.entries(n).forEach((n=>{let[o,i]=n;const l=a?`${a}.${o}`:o;r(i)?e(i,l):t[l]=i}))}(e),t}},3102:(e,t,n)=>{"use strict";n.d(t,{W:()=>o,o:()=>a});var r=n(6540);const a=r.createContext(null);function o(e){let{children:t,value:n}=e;const o=r.useContext(a),i=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...n?.data};return{plugin:t.plugin,data:r}}({parent:o,value:n})),[o,n]);return r.createElement(a.Provider,{value:i},t)}},4070:(e,t,n)=>{"use strict";n.d(t,{zK:()=>b,vT:()=>p,gk:()=>m,Gy:()=>d,HW:()=>v,ht:()=>f,r7:()=>g,jh:()=>h});var r=n(6347),a=n(4586),o=n(7065);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.A)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.B6)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=s(e,t),a=n?.docs.find((e=>!!(0,r.B6)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const u={},d=()=>i("docusaurus-plugin-content-docs")??u,f=e=>function(e,t,n){void 0===t&&(t=o.W),void 0===n&&(n={});const r=i(e),a=r?.[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0});function p(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.zy)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.B6)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function m(e){void 0===e&&(e={});const t=p(e),{pathname:n}=(0,r.zy)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function h(e){return f(e).versions}function g(e){const t=f(e);return l(t)}function b(e){const t=f(e),{pathname:n}=(0,r.zy)();return c(t,n)}function v(e){const t=f(e),{pathname:n}=(0,r.zy)();return function(e,t){const n=l(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},1911:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(9568);const{trackingID:a}=r["docusaurus-plugin-google-gtag"].default,o={onRouteDidUpdate(e){let{location:t,previousLocation:n}=e;n&&t.pathname!==n.pathname&&setTimeout((()=>{window.gtag("config",a,{page_path:t.pathname,page_title:document.title}),window.gtag("event","page_view",{page_title:document.title,page_location:window.location.href,page_path:t.pathname})}))}}},6294:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(5947),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},6134:(e,t,n)=>{"use strict";var r=n(1258),a=n(4784);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(8692)(`./prism-${e}`)})),delete globalThis.Prism}(r.A)},2523:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540);const a={iconExternalLink:"iconExternalLink_lCJq"};function o(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:a.iconExternalLink},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},8916:(e,t,n)=>{"use strict";n.d(t,{A:()=>ct});var r=n(6540),a=n(53),o=n(7489),i=n(4090),l=n(9024),s=n(7559),c=n(1312),u=n(6347),d=n(5062);function f(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}const p={skipToContent:"skipToContent_fXgn"};function m(){const{containerRef:e,handleSkip:t}=function(){const e=(0,r.useRef)(null),{action:t}=(0,u.W6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.querySelector(`.${s.G.wrapper.main}`);t&&f(t)}),[]);return(0,d.$)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&f(e.current)})),{containerRef:e,handleSkip:n}}();return r.createElement("div",{ref:e,role:"region"},r.createElement("a",{href:"#",className:p.skipToContent,onClick:t},r.createElement(c.A,{id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"},"Skip to main content")))}var h=n(5041),g=n(6342),b=n(8168);function v(e){let{width:t=21,height:n=21,color:a="currentColor",strokeWidth:o=1.2,className:i,...l}=e;return r.createElement("svg",(0,b.A)({viewBox:"0 0 15 15",width:t,height:n},l),r.createElement("g",{stroke:a,strokeWidth:o},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const y={announcementBar:"announcementBar_mb4j",announcementBarPlaceholder:"announcementBarPlaceholder_vyr4",announcementBarClose:"announcementBarClose_gvF7",announcementBarContent:"announcementBarContent_xLdY"};function w(){const{isActive:e,close:t}=(0,h.Mj)(),{announcementBar:n}=(0,g.p)();if(!e)return null;const{content:o,backgroundColor:i,textColor:l,isCloseable:s}=n;return r.createElement("div",{className:y.announcementBar,style:{backgroundColor:i,color:l},role:"banner"},s&&r.createElement("div",{className:y.announcementBarPlaceholder}),r.createElement("div",{className:y.announcementBarContent,dangerouslySetInnerHTML:{__html:o}}),s?r.createElement("button",{type:"button",className:(0,a.A)("clean-btn close",y.announcementBarClose),onClick:t,"aria-label":(0,c.T)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},r.createElement(v,{width:14,height:14,strokeWidth:3.1})):null)}var E=n(9876),S=n(3104);var k=n(9532),_=n(5600);const O=r.createContext(null);function x(e){let{children:t}=e;const n=function(){const e=(0,E.M)(),t=(0,_.YL)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,k.ZC)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return r.createElement(O.Provider,{value:n},t)}function A(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function C(){const e=(0,r.useContext)(O);if(!e)throw new k.dV("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,_.YL)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:A(o)})),[a,o,t])}function T(e){let{header:t,primaryMenu:n,secondaryMenu:o}=e;const{shown:i}=C();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,a.A)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":i})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},o)))}var P=n(5293),I=n(2303);function L(e){return r.createElement("svg",(0,b.A)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function D(e){return r.createElement("svg",(0,b.A)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const R={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function N(e){let{className:t,value:n,onChange:o}=e;const i=(0,I.A)(),l=(0,c.T)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===n?(0,c.T)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,c.T)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,a.A)(R.toggle,t)},r.createElement("button",{className:(0,a.A)("clean-btn",R.toggleButton,!i&&R.toggleButtonDisabled),type:"button",onClick:()=>o("dark"===n?"light":"dark"),disabled:!i,title:l,"aria-label":l},r.createElement(L,{className:(0,a.A)(R.toggleIcon,R.lightToggleIcon)}),r.createElement(D,{className:(0,a.A)(R.toggleIcon,R.darkToggleIcon)})))}const j=r.memo(N);function M(e){let{className:t}=e;const n=(0,g.p)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,P.G)();return n?null:r.createElement(j,{className:t,value:a,onChange:o})}var F=n(3465);function B(){return r.createElement(F.A,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function U(){const e=(0,E.M)();return r.createElement("button",{type:"button",className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(v,{color:"var(--ifm-color-emphasis-600)"}))}function z(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(B,null),r.createElement(M,{className:"margin-right--md"}),r.createElement(U,null))}var q=n(5489),H=n(6025),$=n(6654),G=n(1252),V=n(2523);function W(e){let{activeBasePath:t,activeBaseRegex:n,to:a,href:o,label:i,html:l,isDropdownLink:s,prependBaseUrlToHref:c,...u}=e;const d=(0,H.A)(a),f=(0,H.A)(t),p=(0,H.A)(o,{forcePrependBaseUrl:!0}),m=i&&o&&!(0,$.A)(o),h=l?{dangerouslySetInnerHTML:{__html:l}}:{children:r.createElement(r.Fragment,null,i,m&&r.createElement(V.A,s&&{width:12,height:12}))};return o?r.createElement(q.A,(0,b.A)({href:c?p:o},u,h)):r.createElement(q.A,(0,b.A)({to:d,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?(0,G.G)(n,t.pathname):t.pathname.startsWith(f)},u,h))}function K(e){let{className:t,isDropdownItem:n=!1,...o}=e;const i=r.createElement(W,(0,b.A)({className:(0,a.A)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},o));return n?r.createElement("li",null,i):i}function Q(e){let{className:t,isDropdownItem:n,...o}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(W,(0,b.A)({className:(0,a.A)("menu__link",t)},o)))}function Y(e){let{mobile:t=!1,position:n,...a}=e;const o=t?Q:K;return r.createElement(o,(0,b.A)({},a,{activeClassName:a.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var X=n(9169),J=n(4586);var Z=n(1422);function ee(e,t){return e.some((e=>function(e,t){return!!(0,X.ys)(e.to,t)||!!(0,G.G)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function te(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[c,u]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[s]),r.createElement("div",{ref:s,className:(0,a.A)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c})},r.createElement(W,(0,b.A)({"aria-haspopup":"true","aria-expanded":c,role:"button",href:l.to?void 0:"#",className:(0,a.A)("navbar__link",o)},l,{onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),u(!c))}}),l.children??l.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,n)=>r.createElement(_e,(0,b.A)({isDropdownItem:!0,onKeyDown:e=>{if(n===t.length-1&&"Tab"===e.key){e.preventDefault(),u(!1);const t=s.current.nextElementSibling;if(t){(t instanceof HTMLAnchorElement?t:t.querySelector("a")).focus()}}},activeClassName:"dropdown__link--active"},e,{key:n}))))))}function ne(e){let{items:t,className:n,position:o,onClick:i,...l}=e;const s=function(){const{siteConfig:{baseUrl:e}}=(0,J.A)(),{pathname:t}=(0,u.zy)();return t.replace(e,"/")}(),c=ee(t,s),{collapsed:d,toggleCollapsed:f,setCollapsed:p}=(0,Z.u)({initialState:()=>!c});return(0,r.useEffect)((()=>{c&&p(!c)}),[s,c,p]),r.createElement("li",{className:(0,a.A)("menu__list-item",{"menu__list-item--collapsed":d})},r.createElement(W,(0,b.A)({role:"button",className:(0,a.A)("menu__link menu__link--sublist menu__link--sublist-caret",n)},l,{onClick:e=>{e.preventDefault(),f()}}),l.children??l.label),r.createElement(Z.N,{lazy:!0,as:"ul",className:"menu__list",collapsed:d},t.map(((e,t)=>r.createElement(_e,(0,b.A)({mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active"},e,{key:t}))))))}function re(e){let{mobile:t=!1,...n}=e;const a=t?ne:te;return r.createElement(a,n)}var ae=n(2131);function oe(e){let{width:t=20,height:n=20,...a}=e;return r.createElement("svg",(0,b.A)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},a),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const ie="iconLanguage_nlXk";var le=n(961),se=n(5260),ce=n(4255),ue=n(3219),de=n(2967);let fe=null;function pe(e){let{hit:t,children:n}=e;return r.createElement(q.A,{to:t.url},n)}function me(e){let{state:t,onClose:n}=e;const{generateSearchPageLink:a}=(0,ce.n)();return r.createElement(q.A,{to:a(t.query),onClick:n},r.createElement(c.A,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits}},"See all {count} results"))}function he(e){let{contextualSearch:t,externalUrlRegex:a,...o}=e;const{siteMetadata:i}=(0,J.A)(),l=function(){const{locale:e,tags:t}=(0,de.af)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),s=o.searchParameters?.facetFilters??[],d=t?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(l,s):s,f={...o.searchParameters,facetFilters:d},{withBaseUrl:p}=(0,H.h)(),m=(0,u.W6)(),h=(0,r.useRef)(null),g=(0,r.useRef)(null),[v,y]=(0,r.useState)(!1),[w,E]=(0,r.useState)(void 0),S=(0,r.useCallback)((()=>fe?Promise.resolve():Promise.all([n.e(8158).then(n.bind(n,8158)),Promise.all([n.e(1869),n.e(8913)]).then(n.bind(n,8913)),Promise.all([n.e(1869),n.e(5049)]).then(n.bind(n,5049))]).then((e=>{let[{DocSearchModal:t}]=e;fe=t}))),[]),k=(0,r.useCallback)((()=>{S().then((()=>{h.current=document.createElement("div"),document.body.insertBefore(h.current,document.body.firstChild),y(!0)}))}),[S,y]),_=(0,r.useCallback)((()=>{y(!1),h.current?.remove()}),[y]),O=(0,r.useCallback)((e=>{S().then((()=>{y(!0),E(e.key)}))}),[S,y,E]),x=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,G.G)(a,t)?window.location.href=t:m.push(t)}}).current,A=(0,r.useRef)((e=>e.map((e=>{if((0,G.G)(a,e.url))return e;const t=new URL(e.url);return{...e,url:p(`${t.pathname}${t.hash}`)}})))).current,C=(0,r.useMemo)((()=>e=>r.createElement(me,(0,b.A)({},e,{onClose:_}))),[_]),T=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",i.docusaurusVersion),e)),[i.docusaurusVersion]);(0,ue.E8)({isOpen:v,onOpen:k,onClose:_,onInput:O,searchButtonRef:g});const P=(0,c.T)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"});return r.createElement(r.Fragment,null,r.createElement(se.A,null,r.createElement("link",{rel:"preconnect",href:`https://${o.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.createElement(ue.Bc,{onTouchStart:S,onFocus:S,onMouseOver:S,onClick:k,ref:g,translations:{buttonText:P,buttonAriaLabel:P}}),v&&fe&&h.current&&(0,le.createPortal)(r.createElement(fe,(0,b.A)({onClose:_,initialScrollY:window.scrollY,initialQuery:w,navigator:x,transformItems:A,hitComponent:pe,transformSearchClient:T},o.searchPagePath&&{resultsFooterComponent:C},o,{searchParameters:f})),h.current))}function ge(){const{siteConfig:e}=(0,J.A)();return r.createElement(he,e.themeConfig.algolia)}const be={searchBox:"searchBox_ZlJk"};function ve(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,a.A)(n,be.searchBox)},t)}var ye=n(4070),we=n(1754);var Ee=n(5597);const Se=e=>e.docs.find((t=>t.id===e.mainDocId));const ke={default:Y,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:a,...o}=e;const{i18n:{currentLocale:i,locales:l,localeConfigs:s}}=(0,J.A)(),u=(0,ae.o)(),d=[...n,...l.map((e=>{const n=`pathname://${u.createUrl({locale:e,fullyQualified:!1})}`;return{label:s[e].label,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...a],f=t?(0,c.T)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):s[i].label;return r.createElement(re,(0,b.A)({},o,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(oe,{className:ie}),f),items:d}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(ve,{className:n},r.createElement(ge,null))},dropdown:re,html:function(e){let{value:t,className:n,mobile:o=!1,isDropdownItem:i=!1}=e;const l=i?"li":"div";return r.createElement(l,{className:(0,a.A)({navbar__item:!o&&!i,"menu__list-item":o},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,ye.zK)(a),l=(0,we.QB)(t,a);return null===l?null:r.createElement(Y,(0,b.A)({exact:!0},o,{isActive:()=>i?.path===l.path||!!i?.sidebar&&i.sidebar===l.sidebar,label:n??l.id,to:l.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,ye.zK)(a),l=(0,we.fW)(t,a).link;if(!l)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(Y,(0,b.A)({exact:!0},o,{isActive:()=>i?.sidebar===t,label:n??l.label,to:l.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:a,...o}=e;const i=(0,we.Vd)(a)[0],l=t??i.label,s=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(i).path;return r.createElement(Y,(0,b.A)({},o,{label:l,to:s}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:a,dropdownItemsBefore:o,dropdownItemsAfter:i,...l}=e;const s=(0,ye.zK)(n),u=(0,ye.jh)(n),{savePreferredVersionName:d}=(0,Ee.g1)(n),f=[...o,...u.map((e=>{const t=s.alternateDocVersions[e.name]??Se(e);return{label:e.label,to:t.path,isActive:()=>e===s.activeVersion,onClick:()=>d(e.name)}})),...i],p=(0,we.Vd)(n)[0],m=t&&f.length>1?(0,c.T)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):p.label,h=t&&f.length>1?void 0:Se(p).path;return f.length<=1?r.createElement(Y,(0,b.A)({},l,{mobile:t,label:m,to:h,isActive:a?()=>!1:void 0})):r.createElement(re,(0,b.A)({},l,{mobile:t,label:m,to:h,items:f,isActive:a?()=>!1:void 0}))}};function _e(e){let{type:t,...n}=e;const a=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=ke[a];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(o,n)}function Oe(){const e=(0,E.M)(),t=(0,g.p)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(_e,(0,b.A)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function xe(e){return r.createElement("button",(0,b.A)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(c.A,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function Ae(){const e=0===(0,g.p)().navbar.items.length,t=C();return r.createElement(r.Fragment,null,!e&&r.createElement(xe,{onClick:()=>t.hide()}),t.content)}function Ce(){const e=(0,E.M)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(T,{header:r.createElement(z,null),primaryMenu:r.createElement(Oe,null),secondaryMenu:r.createElement(Ae,null)}):null}const Te={navbarHideable:"navbarHideable_m1mJ",navbarHidden:"navbarHidden_jGov"};function Pe(e){return r.createElement("div",(0,b.A)({role:"presentation"},e,{className:(0,a.A)("navbar-sidebar__backdrop",e.className)}))}function Ie(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,g.p)(),i=(0,E.M)(),{navbarRef:l,isNavbarVisible:s}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,S.Mq)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+c{if(e)return t.location.hash?(a.current=!0,void n(!1)):void n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:l,className:(0,a.A)("navbar","navbar--fixed-top",n&&[Te.navbarHideable,!s&&Te.navbarHidden],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown})},t,r.createElement(Pe,{onClick:i.toggle}),r.createElement(Ce,null))}const Le="right";function De(e){let{children:t}=e;return r.createElement(_.y_,null,r.createElement(E.e,null,r.createElement(x,null,t)))}function Re(e){let{width:t=30,height:n=30,className:a,...o}=e;return r.createElement("svg",(0,b.A)({className:a,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},o),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function Ne(){const e=(0,E.M)();return r.createElement("button",{onClick:e.toggle,onKeyDown:e.toggle,"aria-label":"Navigation bar toggle",className:"navbar__toggle clean-btn",type:"button",tabIndex:0},r.createElement(Re,null))}const je={colorModeToggle:"colorModeToggle_DEke"};function Me(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(_e,(0,b.A)({},e,{key:t})))))}function Fe(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function Be(){const e=(0,E.M)(),t=(0,g.p)().navbar.items,[n,a]=function(e){function t(e){return"left"===(e.position??Le)}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return r.createElement(Fe,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(Ne,null),r.createElement(B,null),r.createElement(Me,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(Me,{items:a}),r.createElement(M,{className:je.colorModeToggle}),!o&&r.createElement(ve,null,r.createElement(ge,null)))})}function Ue(){return r.createElement(Ie,null,r.createElement(Be,null))}function ze(e){let{item:t}=e;const{to:n,href:a,label:o,prependBaseUrlToHref:i,...l}=t,s=(0,H.A)(n),c=(0,H.A)(a,{forcePrependBaseUrl:!0});return r.createElement(q.A,(0,b.A)({className:"footer__link-item"},a?{href:i?c:a}:{to:s},l),o,a&&!(0,$.A)(a)&&r.createElement(V.A,null))}function qe(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(ze,{item:t}))}function He(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(qe,{key:t,item:e})))))}function $e(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(He,{key:t,column:e}))))}function Ge(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function Ve(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(ze,{item:t})}function We(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(Ve,{item:e}),t.length!==n+1&&r.createElement(Ge,null))))))}function Ke(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement($e,{columns:t}):r.createElement(We,{links:t})}var Qe=n(1653);const Ye="footerLogoLink_BH7S";function Xe(e){let{logo:t}=e;const{withBaseUrl:n}=(0,H.h)(),a={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(Qe.A,{className:"footer__logo",alt:t.alt,sources:a,width:t.width,height:t.height})}function Je(e){let{logo:t}=e;return t.href?r.createElement(q.A,{href:t.href,className:Ye},r.createElement(Xe,{logo:t})):r.createElement(Xe,{logo:t})}function Ze(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function et(e){let{style:t,links:n,logo:o,copyright:i}=e;return r.createElement("footer",{className:(0,a.A)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(o||i)&&r.createElement("div",{className:"footer__bottom text--center"},o&&r.createElement("div",{className:"margin-bottom--sm"},o),i)))}function tt(){const{footer:e}=(0,g.p)();if(!e)return null;const{copyright:t,links:n,logo:a,style:o}=e;return r.createElement(et,{style:o,links:n&&n.length>0&&r.createElement(Ke,{links:n}),logo:a&&r.createElement(Je,{logo:a}),copyright:t&&r.createElement(Ze,{copyright:t})})}const nt=r.memo(tt);var rt=n(9466);const at="docusaurus.tab.",ot=r.createContext(void 0);function it(e){let{children:t}=e;const n=function(){const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)(((e,t)=>{(0,rt.W)(`${at}${e}`).set(t)}),[]);(0,r.useEffect)((()=>{try{const e={};(0,rt.E)().forEach((t=>{if(t.startsWith(at)){const n=t.substring(at.length);e[n]=(0,rt.W)(t).get()}})),t(e)}catch(e){console.error(e)}}),[]);const a=(0,r.useCallback)(((e,r)=>{t((t=>({...t,[e]:r}))),n(e,r)}),[n]);return(0,r.useMemo)((()=>({tabGroupChoices:e,setTabGroupChoices:a})),[e,a])}();return r.createElement(ot.Provider,{value:n},t)}function lt(e){let{children:t}=e;return r.createElement(P.a,null,r.createElement(h.oq,null,r.createElement(it,null,r.createElement(S.Tv,null,r.createElement(Ee.VQ,null,r.createElement(l.Jx,null,r.createElement(De,null,t)))))))}function st(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(c.A,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("p",null,t.message),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},r.createElement(c.A,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again when the page crashed"},"Try again"))))))}function ct(e){const{children:t,noFooter:n,wrapperClassName:c,title:u,description:d}=e;return(0,i.J)(),r.createElement(lt,null,r.createElement(l.be,{title:u,description:d}),r.createElement(m,null),r.createElement(w,null),r.createElement(Ue,null),r.createElement("div",{className:(0,a.A)(s.G.wrapper.main,c)},r.createElement(o.A,{fallback:e=>r.createElement(st,e)},t)),!n&&r.createElement(nt,null))}},3465:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(8168),a=n(6540),o=n(5489),i=n(6025),l=n(4586),s=n(6342),c=n(1653);function u(e){const{siteConfig:{title:t}}=(0,l.A)(),{navbar:{title:n,logo:u={src:""}}}=(0,s.p)(),{imageClassName:d,titleClassName:f,...p}=e,m=(0,i.A)(u.href||"/"),h={light:(0,i.A)(u.src),dark:(0,i.A)(u.srcDark||u.src)},g=a.createElement(c.A,{sources:h,height:u.height,width:u.width,alt:u.alt||n||t});return a.createElement(o.A,(0,r.A)({to:m},p,u.target&&{target:u.target}),u.src&&(d?a.createElement("div",{className:d},g):g),null!=n&&a.createElement("b",{className:f},n))}},1463:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(6540),a=n(5260);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return r.createElement(a.A,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),o&&r.createElement("meta",{name:"docusaurus_tag",content:o}),i&&r.createElement("meta",{name:"docsearch:language",content:i}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),o&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:o}))}},1653:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(8168),a=n(6540),o=n(53),i=n(2303),l=n(5293);const s={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function c(e){const t=(0,i.A)(),{colorMode:n}=(0,l.G)(),{sources:c,className:u,alt:d,...f}=e,p=t?"dark"===n?["dark"]:["light"]:["light","dark"];return a.createElement(a.Fragment,null,p.map((e=>a.createElement("img",(0,r.A)({key:e,src:c[e],alt:d,className:(0,o.A)(s.themedImage,s[`themedImage--${e}`],u)},f)))))}},1422:(e,t,n)=>{"use strict";n.d(t,{N:()=>h,u:()=>l});var r=n(8168),a=n(6540),o=n(8193);const i="ease-in-out";function l(e){let{initialState:t}=e;const[n,r]=(0,a.useState)(t??!1),o=(0,a.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:o}}const s={display:"none",overflow:"hidden",height:"0px"},c={display:"block",overflow:"visible",height:"auto"};function u(e,t){const n=t?s:c;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function d(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const o=(0,a.useRef)(!1);(0,a.useEffect)((()=>{const e=t.current;function a(){const t=e.scrollHeight,n=r?.duration??function(e){const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${r?.easing??i}`,height:`${t}px`}}function l(){const t=a();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return u(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(l(),requestAnimationFrame((()=>{e.style.height=s.height,e.style.overflow=s.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{l()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function f(e){if(!o.A.canUseDOM)return e?s:c}function p(e){let{as:t="div",collapsed:n,children:r,animation:o,onCollapseTransitionEnd:i,className:l,disableSSRStyle:s}=e;const c=(0,a.useRef)(null);return d({collapsibleRef:c,collapsed:n,animation:o}),a.createElement(t,{ref:c,style:s?void 0:f(n),onTransitionEnd:e=>{"height"===e.propertyName&&(u(c.current,n),i?.(n))},className:l},r)}function m(e){let{collapsed:t,...n}=e;const[o,i]=(0,a.useState)(!t),[l,s]=(0,a.useState)(t);return(0,a.useLayoutEffect)((()=>{t||i(!0)}),[t]),(0,a.useLayoutEffect)((()=>{o&&s(t)}),[o,t]),o?a.createElement(p,(0,r.A)({},n,{collapsed:l})):null}function h(e){let{lazy:t,...n}=e;const r=t?m:p;return a.createElement(r,n)}},5041:(e,t,n)=>{"use strict";n.d(t,{Mj:()=>m,oq:()=>p});var r=n(6540),a=n(2303),o=n(9466),i=n(9532),l=n(6342);const s=(0,o.W)("docusaurus.announcement.dismiss"),c=(0,o.W)("docusaurus.announcement.id"),u=()=>"true"===s.get(),d=e=>s.set(String(e)),f=r.createContext(null);function p(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.p)(),t=(0,a.A)(),[n,o]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{o(u())}),[]);const i=(0,r.useCallback)((()=>{d(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return r.createElement(f.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(f);if(!e)throw new i.dV("AnnouncementBarProvider");return e}},5293:(e,t,n)=>{"use strict";n.d(t,{G:()=>g,a:()=>h});var r=n(6540),a=n(8193),o=n(9532),i=n(9466),l=n(6342);const s=r.createContext(void 0),c="theme",u=(0,i.W)(c),d={light:"light",dark:"dark"},f=e=>e===d.dark?d.dark:d.light,p=e=>a.A.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e),m=e=>{u.set(f(e))};function h(e){let{children:t}=e;const n=function(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.p)(),[a,o]=(0,r.useState)(p(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const i=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(o(t),a&&m(t)):(o(n?window.matchMedia("(prefers-color-scheme: dark)").matches?d.dark:d.light:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(a))}),[a]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&i(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,i]);const s=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||s.current?s.current=window.matchMedia("print").matches:i(null)};return e.addListener(r),()=>e.removeListener(r)}),[i,t,n]),(0,r.useMemo)((()=>({colorMode:a,setColorMode:i,get isDarkTheme(){return a===d.dark},setLightTheme(){i(d.light)},setDarkTheme(){i(d.dark)}})),[a,i])}();return r.createElement(s.Provider,{value:n},t)}function g(){const e=(0,r.useContext)(s);if(null==e)throw new o.dV("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},5597:(e,t,n)=>{"use strict";n.d(t,{VQ:()=>g,XK:()=>y,g1:()=>v});var r=n(6540),a=n(4070),o=n(7065),i=n(6342),l=n(1754),s=n(9532),c=n(9466);const u=e=>`docs-preferred-version-${e}`,d={save:(e,t,n)=>{(0,c.W)(u(e),{persistence:t}).set(n)},read:(e,t)=>(0,c.W)(u(e),{persistence:t}).get(),clear:(e,t)=>{(0,c.W)(u(e),{persistence:t}).del()}},f=e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}])));const p=r.createContext(null);function m(){const e=(0,a.Gy)(),t=(0,i.p)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>f(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=d.read(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(d.clear(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d.save(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=m();return r.createElement(p.Provider,{value:n},t)}function g(e){let{children:t}=e;return l.C5?r.createElement(h,null,t):t}function b(){const e=(0,r.useContext)(p);if(!e)throw new s.dV("DocsPreferredVersionContextProvider");return e}function v(e){void 0===e&&(e=o.W);const t=(0,a.ht)(e),[n,i]=b(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function y(){const e=(0,a.Gy)(),[t]=b();function n(n){const r=e[n],{preferredVersionName:a}=t[n];return r.versions.find((e=>e.name===a))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},6588:(e,t,n)=>{"use strict";n.d(t,{V:()=>l,t:()=>s});var r=n(6540),a=n(9532);const o=Symbol("EmptyContext"),i=r.createContext(o);function l(e){let{children:t,name:n,items:a}=e;const o=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return r.createElement(i.Provider,{value:o},t)}function s(){const e=(0,r.useContext)(i);if(e===o)throw new a.dV("DocsSidebarProvider");return e}},9876:(e,t,n)=>{"use strict";n.d(t,{e:()=>f,M:()=>p});var r=n(6540),a=n(5600),o=n(4581),i=n(6347),l=n(9532);function s(e){!function(e){const{block:t}=(0,i.W6)(),n=(0,l.qd)(e);(0,r.useEffect)((()=>t(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var c=n(6342);const u=r.createContext(void 0);function d(){const e=function(){const e=(0,a.YL)(),{items:t}=(0,c.p)().navbar;return 0===t.length&&!e.component}(),t=(0,o.l)(),n=!e&&"mobile"===t,[i,l]=(0,r.useState)(!1);s((()=>{if(i)return l(!1),!1}));const u=(0,r.useCallback)((()=>{l((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&l(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:i})),[e,n,u,i])}function f(e){let{children:t}=e;const n=d();return r.createElement(u.Provider,{value:n},t)}function p(){const e=r.useContext(u);if(void 0===e)throw new l.dV("NavbarMobileSidebarProvider");return e}},5600:(e,t,n)=>{"use strict";n.d(t,{GX:()=>s,YL:()=>l,y_:()=>i});var r=n(6540),a=n(9532);const o=r.createContext(null);function i(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(o.Provider,{value:n},t)}function l(){const e=(0,r.useContext)(o);if(!e)throw new a.dV("NavbarSecondaryMenuContentProvider");return e[0]}function s(e){let{component:t,props:n}=e;const i=(0,r.useContext)(o);if(!i)throw new a.dV("NavbarSecondaryMenuContentProvider");const[,l]=i,s=(c=n,(0,r.useMemo)((()=>c),[...Object.keys(c),...Object.values(c)]));var c;return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},4090:(e,t,n)=>{"use strict";n.d(t,{w:()=>a,J:()=>o});var r=n(6540);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},4255:(e,t,n)=>{"use strict";n.d(t,{n:()=>l});var r=n(6540),a=n(6347),o=n(4586);const i="q";function l(){const e=(0,a.W6)(),{siteConfig:{baseUrl:t}}=(0,o.A)(),[n,l]=(0,r.useState)("");(0,r.useEffect)((()=>{const e=new URLSearchParams(window.location.search).get(i)??"";l(e)}),[]);return{searchQuery:n,setSearchQuery:(0,r.useCallback)((t=>{const n=new URLSearchParams(window.location.search);t?n.set(i,t):n.delete(i),e.replace({search:n.toString()}),l(t)}),[e]),generateSearchPageLink:(0,r.useCallback)((e=>`${t}search?${i}=${encodeURIComponent(e)}`),[t])}}},4581:(e,t,n)=>{"use strict";n.d(t,{l:()=>c});var r=n(6540),a=n(8193);const o={desktop:"desktop",mobile:"mobile",ssr:"ssr"},i=996;function l(){return a.A.canUseDOM?window.innerWidth>i?o.desktop:o.mobile:o.ssr}const s=!1;function c(){const[e,t]=(0,r.useState)((()=>s?"ssr":l()));return(0,r.useEffect)((()=>{function e(){t(l())}const n=s?window.setTimeout(e,1e3):void 0;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(n)}}),[]),e}},7559:(e,t,n)=>{"use strict";n.d(t,{G:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block"},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},1754:(e,t,n)=>{"use strict";n.d(t,{_o:()=>f,w8:()=>h,C5:()=>d,mz:()=>w,Vd:()=>b,QB:()=>y,fW:()=>v,OF:()=>g});var r=n(6540),a=n(6347),o=n(2831),i=n(4070),l=n(5597),s=n(6588);function c(e){return Array.from(new Set(e))}var u=n(9169);const d=!!i.Gy;function f(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=f(t);if(e)return e}}}const p=(e,t)=>void 0!==e&&(0,u.ys)(e,t),m=(e,t)=>e.some((e=>h(e,t)));function h(e,t){return"link"===e.type?p(e.href,t):"category"===e.type&&(p(e.href,t)||m(e.items,t))}function g(){const e=(0,s.t)(),{pathname:t}=(0,a.zy)(),n=(0,i.vT)()?.pluginData.breadcrumbs;if(!1===n||!e)return null;const r=[];return function e(n){for(const a of n)if("category"===a.type&&((0,u.ys)(a.href,t)||e(a.items))||"link"===a.type&&(0,u.ys)(a.href,t))return r.push(a),!0;return!1}(e.items),r.reverse()}function b(e){const{activeVersion:t}=(0,i.zK)(e),{preferredVersion:n}=(0,l.g1)(e),a=(0,i.r7)(e);return(0,r.useMemo)((()=>c([t,n,a].filter(Boolean))),[t,n,a])}function v(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\n Available sidebar ids are:\n - ${Object.keys(t).join("\n- ")}`);return r[1]}),[e,n])}function y(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`DocNavbarItem: couldn't find any doc with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${c(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function w(e){let{route:t,versionMetadata:n}=e;const r=(0,a.zy)(),i=t.routes,l=i.find((e=>(0,a.B6)(r.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?n.docsSidebars[s]:void 0;return{docElement:(0,o.v)(i,{versionMetadata:n}),sidebarName:s,sidebarItems:c}}},481:(e,t,n)=>{"use strict";n.d(t,{s:()=>a});var r=n(4586);function a(e){const{siteConfig:t}=(0,r.A)(),{title:n,titleDelimiter:a}=t;return e?.trim().length?`${e.trim()} ${a} ${n}`:n}},9024:(e,t,n)=>{"use strict";n.d(t,{e3:()=>f,be:()=>u,Jx:()=>p});var r=n(6540),a=n(53),o=n(5260),i=n(3102);function l(){const e=r.useContext(i.o);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(6025),c=n(481);function u(e){let{title:t,description:n,keywords:a,image:i,children:l}=e;const u=(0,c.s)(t),{withBaseUrl:d}=(0,s.h)(),f=i?d(i,{absolute:!0}):void 0;return r.createElement(o.A,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),a&&r.createElement("meta",{name:"keywords",content:Array.isArray(a)?a.join(","):a}),f&&r.createElement("meta",{property:"og:image",content:f}),f&&r.createElement("meta",{name:"twitter:image",content:f}),l)}const d=r.createContext(void 0);function f(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,a.A)(i,t);return r.createElement(d.Provider,{value:l},r.createElement(o.A,null,r.createElement("html",{className:l})),n)}function p(e){let{children:t}=e;const n=l(),o=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const i=`plugin-id-${n.plugin.id}`;return r.createElement(f,{className:(0,a.A)(o,i)},t)}},9532:(e,t,n)=>{"use strict";n.d(t,{ZC:()=>i,dV:()=>l,qd:()=>o});var r=n(6540);const a=n(8193).A.canUseDOM?r.useLayoutEffect:r.useEffect;function o(e){const t=(0,r.useRef)(e);return a((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function i(e){const t=(0,r.useRef)();return a((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){super(),this.name="ReactContextError",this.message=`Hook ${this.stack?.split("\n")[1]?.match(/at (?:\w+\.)?(?\w+)/)?.groups.name??""} is called outside the <${e}>. ${t??""}`}}},1252:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{G:()=>r})},9169:(e,t,n)=>{"use strict";n.d(t,{Dt:()=>l,ys:()=>i});var r=n(6540),a=n(8328),o=n(4586);function i(e,t){const n=e=>(!e||e.endsWith("/")?e:`${e}/`)?.toLowerCase();return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.A)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.A,baseUrl:e})),[e])}},3104:(e,t,n)=>{"use strict";n.d(t,{Mq:()=>d,Tv:()=>s,gk:()=>f});var r=n(6540),a=n(8193),o=n(2303),i=n(9532);const l=r.createContext(void 0);function s(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(l.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(l);if(null==e)throw new i.dV("ScrollControllerProvider");return e}const u=()=>a.A.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),a=(0,r.useRef)(u()),o=(0,i.qd)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function f(){const e=(0,r.useRef)(null),t=(0,o.A)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>e.current?.()}}},2967:(e,t,n)=>{"use strict";n.d(t,{Cy:()=>i,af:()=>s,tU:()=>l});var r=n(4070),a=n(4586),o=n(5597);const i="default";function l(e,t){return`docs-${e}-${t}`}function s(){const{i18n:e}=(0,a.A)(),t=(0,r.Gy)(),n=(0,r.gk)(),s=(0,o.XK)();const c=[i,...Object.keys(t).map((function(e){const r=n?.activePlugin.pluginId===e?n.activeVersion:void 0,a=s[e],o=t[e].versions.find((e=>e.isLast));return l(e,(r??a??o).name)}))];return{locale:e.currentLocale,tags:c}}},9466:(e,t,n)=>{"use strict";n.d(t,{E:()=>s,W:()=>l});const r="localStorage";function a(e){if(void 0===e&&(e=r),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,o||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),o=!0),null}var t}let o=!1;const i={get:()=>null,set:()=>{},del:()=>{}};function l(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t}}(e);const n=a(t?.persistence);return null===n?i:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{n.setItem(e,t)}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{n.removeItem(e)}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}}}}function s(e){void 0===e&&(e=r);const t=a(e);if(!t)return[];const n=[];for(let r=0;r{"use strict";n.d(t,{o:()=>o});var r=n(4586),a=n(6347);function o(){const{siteConfig:{baseUrl:e,url:t},i18n:{defaultLocale:n,currentLocale:o}}=(0,r.A)(),{pathname:i}=(0,a.zy)(),l=o===n?e:e.replace(`/${o}/`,"/"),s=i.replace(e,"");return{createUrl:function(e){let{locale:r,fullyQualified:a}=e;return`${a?t:""}${function(e){return e===n?`${l}`:`${l}${e}/`}(r)}${s}`}}}},5062:(e,t,n)=>{"use strict";n.d(t,{$:()=>i});var r=n(6540),a=n(6347),o=n(9532);function i(e){const t=(0,a.zy)(),n=(0,o.ZC)(t),i=(0,o.qd)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6342:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(4586);function a(){return(0,r.A)().siteConfig.themeConfig}},2983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[a]=e.split(/[#?]/),o="/"===a||a===r?a:(i=a,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(a,o)}},440:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="post-content";var a=n(2983);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}})},53:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;ta});const a=function(){for(var e,t,n=0,a="";n{"use strict";n.d(t,{zR:()=>w,TM:()=>x,yJ:()=>p,sC:()=>C,AO:()=>f});var r=n(8168);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;f--){var p=i[f];"."===p?o(i,f):".."===p?(o(i,f),d++):d&&(o(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function p(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.A)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=p(e,t,h(),w.location);u.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(4363),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=p(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},4634:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},435:(e,t,n)=>{"use strict";n.r(t)},119:(e,t,n)=>{"use strict";n.r(t)},1043:(e,t,n)=>{"use strict";n.r(t)},5947:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),c=o.querySelector(r.barSelector),u=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&p(a),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},5228:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,a){for(var o,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s{"use strict";n.d(t,{A:()=>o});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);k+=S.value.length,S=S.next){var _=S.value;if(t.length>e.length)return;if(!(_ instanceof a)){var O,x=1;if(v){if(!(O=o(E,k,e,b))||O.index>=e.length)break;var A=O.index,C=O.index+O[0].length,T=k;for(T+=S.value.length;A>=T;)T+=(S=S.next).value.length;if(k=T-=S.value.length,S.value instanceof a)continue;for(var P=S;P!==t.tail&&(Td.reach&&(d.reach=R);var N=S.prev;if(L&&(N=s(t,N,L),k+=L.length),c(t,N,x),S=s(t,N,new a(f,g?r.tokenize(I,g):I,y,I)),D&&s(t,S,D),x>1){var j={cause:f+","+m,reach:R};i(e,t,n,S.prev,k,j),d&&j.reach>d.reach&&(d.reach=j.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a"+o.content+""},r}(),a=r;r.default=r,a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},a.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.c=a.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),a.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),a.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},a.languages.c.string],char:a.languages.c.char,comment:a.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:a.languages.c}}}}),a.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete a.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(a),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:a})}(a),a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(a),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(a),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(a),a.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:a.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},a.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var l=f(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,a=r.inside["interpolation-punctuation"],o=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var a={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(a.code,a.grammar),e.hooks.run("after-tokenize",a),a.tokens}function c(t){var n={};n["interpolation-punctuation"]=a;var o=e.tokenize(t,n);if(3===o.length){var i=[1,1];i.push.apply(i,s(o[1],e.languages.javascript,"javascript")),o.splice.apply(o,i)}return new e.Token("interpolation",o,r.alias,t)}function u(t,n,r){var a=e.tokenize(t,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),i=0,u={},d=s(a.map((function(e){if("string"==typeof e)return e;for(var n,a=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=a,n})).join(""),n,r),f=Object.keys(u);return i=0,function e(t){for(var n=0;n=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=f[i],o="string"==typeof r?r:r.content,l=o.indexOf(a);if(-1!==l){++i;var s=o.substring(0,l),d=c(u[a]),p=o.substring(l+a.length),m=[];if(s&&m.push(s),m.push(d),p){var h=[p];e(h),m.push.apply(m,h)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,a=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(a),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function o(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return a})),RegExp(e,t)}a=o(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===i(a.content[0].content[1])&&n.pop():"/>"===a.content[a.content.length-1].content||n.push({tagName:i(a.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:o=!0),(o||"string"==typeof a)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(a);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}a.content&&"string"!=typeof a.content&&l(a.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(a),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],a=[];/^\w+$/.test(n)||a.push(/\w+/.exec(n)[0]),"diff"===n&&a.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(a),a.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},a.languages.go=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),a.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete a.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[a],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++a;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(m+p.length),v=[];h&&v.push.apply(v,i([h])),v.push(g),b&&v.push.apply(v,i([b])),"string"==typeof c?l.splice.apply(l,[s,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(a),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(a),a.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},a.languages.webmanifest=a.languages.json,a.languages.less=a.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),a.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),a.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},a.languages.objectivec=a.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete a.languages.objectivec["class-name"],a.languages.objc=a.languages.objectivec,a.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},a.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},a.languages.python["string-interpolation"].inside.interpolation.inside.rest=a.languages.python,a.languages.py=a.languages.python,a.languages.reason=a.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),a.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete a.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(a),a.languages.scss=a.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),a.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),a.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),a.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),a.languages.scss.atrule.inside.rest=a.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(a),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(a),a.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const o=a},6969:e=>{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},8722:(e,t,n)=>{const r=n(6969),a=n(8380),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(3157).resolve(t)],delete Prism.languages[e],n(3157)(t),o.add(e)}))}i.silent=!1,e.exports=i},8692:(e,t,n)=>{var r={"./":8722};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=8692},3157:(e,t,n)=>{var r={"./":8722};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=3157},8380:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var l={},s=e[r];if(s){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in a(t,o),l[t]=!0,n[t])l[i]=!0}t(s.require,c),t(s.optional,c),t(s.modify,c)}n[r]=l,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(s);i=i.map(c),l=(l||[]).map(c);var u=n(i),d=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var f,p=r(s),m=u;a(m);){for(var h in f={},m){var g=s[h];t(g&&g.modify,(function(e){e in d&&(f[e]=!0)}))}for(var b in d)if(!(b in u))for(var v in p(b))if(v in u){f[b]=!0;break}for(var y in m=f)u[y]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,l={},s={};function c(e){if(e in l)return l[e];s[e]=!0;var a,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)a=r(e);else{var f=i(u.map((function(e){var t=c(e);return delete s[e],t})));o?a=o(f,(function(){return r(e)})):r(e)}return l[e]=a}for(var u in n)c(u);var d=[];for(var f in s)d.push(l[f]);return i(d)}(p,u,t,n)}};return w}}();e.exports=t},2694:(e,t,n)=>{"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556:(e,t,n)=>{e.exports=n(2694)()},6925:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2551:(e,t,n)=>{"use strict";var r=n(6540),a=n(5228),o=n(9982);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n