File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,6 +89,26 @@ const StyleSheetServer = typeof window !== 'undefined'
8989 } ,
9090 } ;
9191 } ,
92+ /**
93+ * Prevent styles from being injected into the DOM.
94+ *
95+ * This is useful in situations where you do not have an available DOM
96+ * but are still considering walking the tree without calling a renderFunc
97+ *
98+ * Should be paired with a subsequent call to
99+ * clearBufferAndResumeStyleInjection.
100+ */
101+ suppressStyleInjection ( ) {
102+ reset ( ) ;
103+ startBuffering ( ) ;
104+ } ,
105+
106+ /**
107+ * Opposite method of suppressStyleInjection.
108+ */
109+ clearBufferAndResumeStyleInjection ( ) {
110+ reset ( ) ;
111+ } ,
92112 } ;
93113
94114/**
Original file line number Diff line number Diff line change @@ -74,6 +74,20 @@ interface StaticRendererResult {
7474 */
7575interface StyleSheetServerStatic {
7676 renderStatic ( renderFunc : ( ) => string ) : StaticRendererResult ;
77+ /**
78+ * Prevent styles from being injected into the DOM.
79+ *
80+ * This is useful in situations where you do not have an available DOM
81+ * but are still considering walking the tree without calling a renderFunc
82+ *
83+ * Should be paired with a subsequent call to
84+ * clearBufferAndResumeStyleInjection.
85+ */
86+ suppressStyleInjection ( ) : void ;
87+ /**
88+ * Opposite method of suppressStyleInjection.
89+ */
90+ clearBufferAndResumeStyleInjection ( ) : void ;
7791}
7892
7993export var StyleSheetServer : StyleSheetServerStatic ;
You can’t perform that action at this time.
0 commit comments